2

With the deprecation of mysql_ functions from PHP 7, I think it would be beneficial from the community to display generic warning messages on past answers using any mysql_ functions.

An idea of the message could be:

This answer used deprecated and removed (as of PHP 7) mysql_ functions. If you use this code we recommend to update them to mysqli_ or use PDO.

The idea is not related to people asking new questions, but more directed at people who take code from past questions and answers. I think tackling the source could be more beneficial, because not everyone who uses the code will be a registered member or post a question.

The idea would be to only show this message if a mysql_ function is used in a code block within an answer, as to avoid any false positives.

Edit: For clarity, my question relates to past answers, not new questions.

10
  • 1
    1) It is not deprecated anymore, it got completely removed 2) Looking at this question in a more abstract way it is about deprecated code/answers. And this has already been discussed.
    – Rizier123
    Commented Jun 28, 2016 at 17:09
  • mysql_ was deprecated for several years. I feel ashamed when I see how many users still use mysql_ functionality. Now the time has come where they find their script not working...
    – tkausl
    Commented Jun 28, 2016 at 17:09
  • @Rizier123 I'll edit my question to update wording that it has been removed. Could you also provide a link to past discussions of tackling this in a historic way, rather than on new questions only Commented Jun 28, 2016 at 17:10
  • @vaultah That topic is more directed at targeting new questions, not historic answers. Commented Jun 28, 2016 at 17:11
  • Some answers might involve saying "myslq_ is obsolete", do this instead. An automated script marks such answers as obsolete might be bad. Commented Jun 28, 2016 at 17:19
  • @AlexanderO'Mara I understand where you're coming from, but to do this for all past answers manually would be painstakingly time consuming. Commented Jun 28, 2016 at 17:21
  • True, perhaps limiting it to appearing in code blocks would be enough. Commented Jun 28, 2016 at 17:22
  • @AlexanderO'Mara Oh, yes I see what you mean now. Yeah, only displaying the message if found within a code block in the answer would be best. Commented Jun 28, 2016 at 17:24
  • Beware being accused of spamming if you decide to do something about this.
    – jscs
    Commented Jun 28, 2016 at 17:33

0

Browse other questions tagged .