Saturday, 1 February 2014

Why shouldn't I use mysql_* functions in PHP?

The MySQL extension is:
  • Not under active development
  • Officially deprecated (as of PHP 5.5. It's likely to be removed in the next major release.)
  • Lacks an OO interface
  • Doesn't support:
    • Non-blocking, asynchronous queries
    • Prepared statements or parameterized queries
    • Stored procedures
    • Multiple Statements
    • Transactions
    • All of the functionality in MySQL 5.1
Since it is deprecated, using it makes your code less future proof.
Lack of support for prepared statements is particularly important as they provide a clearer, less error prone method of escaping and quoting external data than manually escaping it with a separate function call.
See the comparison of SQL extensions.

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More