top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Looking for a good working PDO and/or mysqli database class to get started with OOP

0 votes
423 views

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

posted May 31, 2013 by anonymous

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

1 Answer

0 votes

PDO IS an OOP implementation. Why would you want to encapsulate it?
Accessing a database requires SQL with arguments dependant on YOUR database schema.
You have to do that work; there is no way around it.

answer May 31, 2013 by anonymous
Sounds like the he is asking for a pre-built CRUD interface that adapts to his tables and their relationships. It's a fair question, just one I don't have an answer to. There must be some kind of ORM for PHP?

Similar Questions
0 votes

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.

+2 votes

I have moderate level PHP programming skills. I am also interested in merging those skills inside of the WordPress app. With their advanced responsive design themes and many other functions it seems like a good idea. I have tried loading some PHP plug-ins in WP – but I don't seem to get them to do more than basics.

Can anybody help me on how I can get started working with PHP/MySQL inside of the WordPress app?

...