Updating from MYSQL to MYSQLI [duplicate]

Solution 1:

You can download a converter tool from here:

https://github.com/philip/MySQLConverterTool

The code it generates is pretty gross, mainly because of the way it implements the default database link argument with a $GLOBAL variable. (This also makes it easy to recognize when someone is using code that's gone through the converter.)

There's also a MySQL Shim Library located here:

https://github.com/dshafik/php7-mysql-shim

Solution 2:

The best place to transform is to look at the php reference library. Very easy to use and will tell you everything you need to know:

http://www.php.net/manual/en/mysqli.query.php