Jump to content

mysql_ not deprecated in php 5.5.3?


Recommended Posts

I recently upgraded to 5.5.3 and I read that mysql_ functions are deprecated, which is great and I would like to ensure a warning is seen when mysql_ functions are used.  So I set my error reporting ON and still any use of mysql_ functions does not result in a deprecation warning.  Do I need to change something other than doing this:

 

error_reporting(E_ALL);
ini_set('display_errors', 1);

 

Or, why does calling a mysql_ function not result in a deprecation warning?

 

phpinfo() tells me I am on php 5.5.3

Link to comment
https://forums.phpfreaks.com/topic/282760-mysql_-not-deprecated-in-php-553/
Share on other sites

this is from the 5.5.0 change log -

 

mysql: This extension is now deprecated, and deprecation warnings will be generated when connections are established to databases via mysql_connect(), mysql_pconnect(), or through implicit connection:

 

 

are you setting the error_reporting/display_errors before you are making the connection?

Thanks mac_gyver, I hadn't spotted that!  The file that set the error reporting occurred just after the database connection, so you are spot on with that.  Moved the error reporting up a couple of lines, and the deprecation warning now comes up just as expected.  Very many thanks.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.