1

I have some problem with Deprecated warning.

I am making a php web application. I am using core php in my office, and I tried to use same code in my house bt Depricated warning makes me trouble. I know it can be removed using mysqli or PDO. But I use mysql method many times so I have to change it many times.

Here I am trying to ask is that can I use any method to disable the warning.

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • Then disable the warnings. But don't come back here when your code stops working altogether after the next system update. – mario Feb 13 '16 at 10:41

1 Answers1

0

To disable warning to have to change the display errors level.

error_reporting( E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED );

This set disable Notices, Strict and deprecated warnings, but output others errors.

Anyway, please note that mysql_ was permanently removed in PHP 7, so you have to migrate to mysqli or PDO to preserve compatibility code.

Disabling warnings you're just putting off a to-do action.

fusion3k
  • 11,568
  • 4
  • 25
  • 47