I have just read about http://marc.info/?l=php-internals&m=131031747409271&w=2.
I use mysql_query in all my php code for the last year to access my mysql databases.
Does the information at that link, from the PHP leader, mean I can no longer use mysql_query?
Will mysql_query stop working in the future? If so, when will this happen? What is the new way to access a mysql database with php?
Would someone mind simplifying what the link is saying in simply english?
I am worried, thank you.
Extra:
What does deprecated actually mean, it is not a common word for non technical people…? instead of mysql_query, what do I use? Do I write mysqli_query? or PDO_query? what is the difference between mysql and mysqli and pdo queries? Do I need to use mysqli or pdo software instead of mysql databases?
For years now, it’s been recommended to use The MySQLi or PDO extensions — and not the old MySQL one.
As a reference, see this page of the PHP manual : [**Overview of APIs**][1] *(quoting)* :
The link you posted states that `mysql_*` functions are not going to disappear soon, so don’t panick *(quoting)* :
But the idea is that `mysql_*` functions should not be used anymore *(as it’s been the case for years already)* — but people are still using these, instead of [**PDO**][2] or [**MySQLi**][3].
An idea / proposition to help people realize that there are better solutions than
mysql_*would be to mark those old functions as deprecated — in a future version of the language.It will probably not happen for PHP 5.4 (which is already in alpha stage) ; maybe for PHP 5.5 — but that one is far from released — probably at least two years…
Right now, for your new projects, you should probably not use `mysql_*` ; instead, you should use MySQLi or PDO, which are more recent, and support more features of the MySQL server.
But for your old code, it’s probably OK to keep using the
mysql_*functions — at least for a while: no need to re-write your existing applications.It means that, when those functions are deprecated and you try calling them, you will get a warning saying you are using old functions, that should not be used anymore — and that will disappear one day or another.
Read the documentation of MySQLi and PDO 😉
Those are two extensions :
On the Server-side, you will still use the same MySQL Server.
On the client-side, you choose the extension you want.