Social Icons

Thursday, March 20, 2014

Why you shouldn't use mysql_* functions in php?

To use php with mysql database, there are many php functions for it. For example: mysql_connect(), mysql_select_db(), mysql_query(), mysql_real_escape_string() etc. Now you need to move away from it and stop using these functions. 

Very straight forward answer to stop using these functions is that they are outdated. These functions ae likely to be deprecated in higher versions of php. Some important reasons to avoid these can be concluded as below: 
  • They are likely to be deprecated.
  • All Mysql 5.1 functionalities are not supported.
  • They don't support stored procedures.
  • They don't support multiple statements etc.

You can start using mysqli or PDO extensions APIs to do the database sort of things.

Total Pageviews