PDO or MYSQLi?

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

sendy
New php-forum User
New php-forum User
Posts: 9
Joined: Thu Oct 25, 2012 9:47 pm

PDO or MYSQLi?

Postby sendy » Mon Nov 12, 2012 8:47 am

hi guys, i dont know if its appropriate to post such topic in this forum but, here's the question:

i read beginning PHP by m*tt doyle, it teaches PDO object for database, then yesterday i came to a discussion about "PDO vs MYSQLi", many say "use PDO" and many say "use MYSQLi".
So, whats the best thing to learn first for beginner? pdo or mysqli? please give your reason why

thx,
Sendy Halim

MeroD
New php-forum User
New php-forum User
Posts: 53
Joined: Wed Oct 10, 2012 12:14 am

Re: PDO or MYSQLi?

Postby MeroD » Mon Nov 12, 2012 10:13 pm

If you are taking the procedural route, definitely stick with mysqli. If you are learning to code using objects and classes, use PDO.

Regardless, here's some articles on the issue:
http://net.tutsplus.com/tutorials/php/p ... d-you-use/
http://stackoverflow.com/questions/1356 ... s-and-cons
http://www.sitepoint.com/forums/showthr ... -vs-MySQLi

johnj
php-forum Super User
php-forum Super User
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: PDO or MYSQLi?

Postby johnj » Tue Nov 13, 2012 6:45 am

First time beginner - start with mysqli.

seandisanti
php-forum Fan User
php-forum Fan User
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm

Re: PDO or MYSQLi?

Postby seandisanti » Tue Nov 13, 2012 9:02 am

Why worry about best to learn as a beginner? Want to learn it one way when you're new then learn the right way once you've internalized that way? MeroD's answer is spot on, it's a matter of preference based on the way you're programming your project.


Return to “PHP coding => General”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest