top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Moving from mysql functions to mysqli or PDO - which is best?

0 votes
373 views

I'm attempting to move away from PHP mysql functions to something newer, either mysqli or PDO.

I have read various things about them, but I'm curious at this point which would be best to learn for the present and future. I'm usually working on small to medium size projects.

I understand that PDO has an extra abstraction layer so it can work with / convert to other databases like oracle and others fairly easily, but some have said that PDO can be a bit slower the MySQLi?

So I would really like to hear opinions on the best choices of either MySQLi or PDO.

Also I'm also trying to learn OOP, so I'm looking for a very good working PDO and/or mysqli database class - to get started with, that has all the basic needs like UPDATE - INSERT - DELETE - QUERY etc. That would be very helpful.

posted May 18, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Probably some people will say PDO, others will say MySQLi, in general it doesn't really matter, and I think you have named the biggest differences in your mail.

So if you're going to stick with MySQL anyway, you can take advantage of the speed with MySQLi.

What class are you looking for? MySQLi can be used as a class, and PDO is a class too?

answer May 18, 2013 by anonymous
Similar Questions
0 votes

I'm looking for a very good, pre made, working PDO and/or mysqli database class (in a wrapper) - to get started with, that has all the basic needs like UPDATE - INSERT - DELETE - QUERY etc. That would be very helpful. I'm also trying to learn OOP, and creating my own class to start out is over my head, so one that is recommended here would be a good start.

There are many examples on the net - The problem is that commenters often have issues with the code, and as a beginner in this area - these issues are sometimes over my head and it would be best for me if someone could recommend a good working standard model to start.

Q: DOES ANYONE HAVE ANY OPINIONS ON THE ONES BELOW?
https://github.com/ajillion/PHP-MySQLi-Database-Class
http://www.phpclasses.org/package/2359-PHP-MySQL-database-wrapper-using-MySQLi-extension.html
http://snipplr.com/view/22992/

Jeffrey Way...
http://forrst.com/posts/Mysqli_Database_Class-hxb
http://www.dotred.be/blog/database-classes-for-mysql-mysqli-and-mssql/

PDO...
Jeffrey Way - some issues here in comments
http://net.tutsplus.com/tutorials/php/php-database-access-are-you-doing-it-correctly/
http://www.phpclasses.org/package/7533-PHP-Access-SQL-databases-using-PDO.html
http://www.doctrine-project.org/projects/dbal.html
http://pear.php.net/package/MDB2

–1 vote

I want to update my sql database record and want to populate the value of previous record. So anybody can help me to get the previous value of the record to show when the update require.

...