Possible Duplicate:
mysqli or PDO - what are the pros and cons?
PHP PDO and MySQLi
I recently asked a question that resulted in people telling me to use "PDO" over MySQL. Why is that? What advantages does it have over the other?
Possible Duplicate:
mysqli or PDO - what are the pros and cons?
PHP PDO and MySQLi
I recently asked a question that resulted in people telling me to use "PDO" over MySQL. Why is that? What advantages does it have over the other?
The mysql_*
functions are no longer maintained and community has begun the deprecation process. Instead you should learn about prepared statements and use either PDO or MySQLi.
If you cannot decide, this article should help you choose. Though, you should know, that PDO is able to work with different kinds of RDBMS, while MySQLi is made for a specific one.
In case you decide to go with PDO, it's recommended you follow this tutorial.
For one, mysql_* functions will be deprecated.
Secondly, PDO functions are easier to use and can be used with non-MySQL databses.
Also worth noting might be that you don't have to use PDO, mysqli is fine as well!
PDO provides you with uniform methods to access various kinds of database. Having a quick look on the Internet could be beneficial.