Q:

Future of the PHP MySQL functions

According to the PHP.net web site, the MySQL extension is deprecated as of PHP 5.5+  Given the large number of PHP sites that use MySQL, I'd like to know what the best practices would be for existing sites using MySQL.  Would you stabilize your site on a version of PHP that supported MySQL?  Or take on the cost and time commitment to migrate to another DB extension?

A:

If you have the development time then I would highly recommend moving to PDO or MySQLi.  Those extensions will be maintained and officially supported by the PHP group.
If your application is really stable and secure then I would disable the warning that 5.5 will generate.  When the extension is removed, I am certain it will still exist as a PECL extension which I would then include.  

A:

The MySQL extension is being deprecated, not MySQL support as a whole. PHP is currently trying to push the new MySQLi extension as a replacement:
http://php.net/manual/en/book.mysqli.php
MySQLi improves upon the old functions, allowing you to perform MySQL functions procedurally (as before) or with objects.

A:

I'd like to know what the best practices would be for existing sites using MySQL.

This one is easy to answer.
There should be no Mysql (as well as Mysqli or PDO) functions in your application code at all.
If you're using raw API functions like this
$data   = array();
$name   = mysql_real_escape_string($_GET['name']);
$result = mysql_query("SELECT * FROM table WHERE name = '$name'");
while ($row = mysql_fetch_row($result)){   
    $data[] = $row;
}

then you have to start rewriting your codes immediatey, using some database wrapper instead of direct raw API calls, to make it look like this:
$data = $db->getAll("SELECT * FROM table where name=?s",$_GET['name']); 

It will not only shorten and smarten your codes dramatically, but also put all the API calls in one library, where it can be changed to whatever new API when PHP team decided to kill another excellent ext.

