Home » Php » php – How do I migrate my site from mysql to mysqli?

php – How do I migrate my site from mysql to mysqli?

Posted by: admin April 23, 2020 Leave a comment

Questions:

Is there anything I have to do on the database end or is it just the php that changes? Can I just substitute mysqli functions for mysql functions? Anything else I should know?

How to&Answers:

I advise you to read through this. A lot of helpful information for what you want to do, plus a tool to help. See: Converting to MySQLi.

It’s just the PHP that changes.

Answer:

Everything I know about it says that the only changes you will have to make will be in the PHP. With that said be careful not all functions have the same name between the two so be careful changing from mysql_* to mysqli_*.

The site php.net will be your best friend.

Answer:

Also if you are migrating you should look into using PHP Data Objects (PDO) http://php.net/manual/en/book.pdo.php