Saturday, November 28th, 2015

mysql_ Interface END OF LIFE

The original interface for accessing mySQL databases from PHP that was around even before PHP 3 was released used procedural functions where the names start with mysql_

The release of PHP 5.0 on 13th July 2004 introduced an improved interface called MYSQLi that has both procedural and OOP variants. This was soon followed by another OOP alternative called PDO.

On 20th June 2013 the old mysql interface was deprecated (flagged as obsolete in preparation to be removed) with the introduction of PHP 5.5. By that point the two far superior interfaces had been around for almost nine years and had been the recommended way way to access mySQL for many years. This gave those who had not yet converted from the antiquated interface to one of the two newer ones almost two and a half years notice that they needed to convert their calls.

The introduction of PHP 7 currently scheduled for 3rd December 2015 carries out the second step of the deprecation process by removing support completely for the code previously flagged as obsolete.

What is really worrying is the number of people asking for help with their PHP database calls who appear to have failed to convert to one of the interfaces introduced over eleven years ago and still use the old interface even though it was flagged as obsolete over two years ago and will no longer exist in a few days. Fortunately for them they can still stick with the old PHP 5.6 version that does support the obsolete interface (at least until active support for it ends on 28th August next year) and so still have another six months to complete their conversion provided their hosting provider doesn’t force them to upgrade earlier than that.

If you are still using mysql_ calls then what are you waiting for – stop reading and get converting as you are already at least two and a half years behind in ensuring your code will continue to work next week.

Comments are closed.