PHP: Deprecated: The mysql extension is deprecated and will be removed in the future:

gotta love this one, common PHP functions we have used for years are now going to be phased out, and we get warnings all over our pretty web page reminding us. How to fix

Option 1:
set error reporting in php.ini to
error_reporting = E_ALL ^ E_DEPRECATED

Option 2:
remove the warning by adding a ‘@’ before the function
such as:
$connect = @mysql_connect(‘localhost’,’root’,”);
or
ereg

Option 3:
Update your code to use the NEW functions (watch it, they changed around syntax on some
example:

$query = “Here the query you are going to perform”;

//QUERY PHP 5.4 o earlier (DEPRECATED)
$result = mysql_query ($query) or exit(“The query could not be performed”);

//QUERY PHP 5.5 (NEW EXTENSION)
$result = mysqli_query ($query) or exit(“The query could not be performed”);

note: ereg() has been replaced with preg_match()

Leave a Reply

Your email address will not be published. Required fields are marked *