PHP Classes
elePHPant
Icontem

PHP MySQL/MySQLi/PDO Function Maps

Recommend this page to a friend!

      PHP MySQL to MySQLi  >  PHP MySQL to MySQLi package blog  >  How to Convert MySQL ...  >  All threads  >  PHP MySQL/MySQLi/PDO Function Maps  >  (Un) Subscribe thread alerts  
Subject:PHP MySQL/MySQLi/PDO Function Maps
Summary:Here's a three-column summary
Messages:4
Author:Ray Paseur
Date:2017-11-20 13:49:59
 

  1. PHP MySQL/MySQLi/PDO Function Maps   Reply   Report abuse  
Ray Paseur - 2017-11-20 13:49:59
About five years ago I put together this quick reference guide. If you find errors, please PM me and I'll fix it up, thanks.
iconoun.com/mysql_mysqli_pdo_functi ...

  2. Re: PHP MySQL/MySQLi/PDO Function Maps   Reply   Report abuse  
Dave Smith - 2017-11-20 14:32:11 - In reply to message 1 from Ray Paseur
You should include the procedural methods in addition to the object oriented methods. Most migration from mysql to mysqli will be using the procedural methods.

Dave

  3. Re: PHP MySQL/MySQLi/PDO Function Maps   Reply   Report abuse  
Ray Paseur - 2017-11-20 14:43:30 - In reply to message 2 from Dave Smith
Dave: Try the links in the middle column. The PHP man pages show both procedural and OOP.
iconoun.com/mysql_mysqli_pdo_functi ...

I've also found through personal experience that converting MySQL to MySQLi was often easier if you used OOP MySQLi. Here's an article I wrote for Experts-Exchange showing how and why. See the "Object-Oriented or Procedural" paragraph.
experts-exchange.com/articles/11177 ...

Good "How to Convert..." article, BTW!

  4. Re: PHP MySQL/MySQLi/PDO Function Maps   Reply   Report abuse  
Dave Smith - 2017-11-20 15:16:24 - In reply to message 3 from Ray Paseur
Oh okay, I didn't realize they where links to the php manual since I didn't hover over them.

As far as procedural vs object oriented methods, it is 6 of one or half a dozen of the other.

As far as your first argument, I would never recommend that someone migrate query by query, why they would even want to try it escapes me.

Your 4th argument is the only one that holds any weight with the implied connection. I still believe that most will want to just add the i to mysql and include the link in the arguments instead of getting the correct object and method.

Like I said though, it is a matter of personal preference.

After migration they should rewrite the code, which is where I recommend they move over to object oriented code and also start using prepared statements.

Dave