Jump to content

mysql_ not deprecated in php 5.5.3?


Go to solution Solved by mac_gyver,

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
Share on other sites

  • Solution

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.