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 tomysqli_
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.
mysql_
was deprecated for several years. I feel ashamed when I see how many users still usemysql_
functionality. Now the time has come where they find their script not working...myslq_
is obsolete", do this instead. An automated script marks such answers as obsolete might be bad.