If a beginner searches on Google about PHP and MySQL, they mostly get the links below, at least according to Google in my country/area:
- MYSQL PHP Select
- how can i fetch data from database in php using mysql?
- PHP connect to mysql database
- Simple search MySQL database using php
- select count(*) from table of mysql in php
- can't connect to mysql with php
These are some examples of what I got while searching on Google about the same, as you can see, the accepted answers mostly reflect the usage of deprecated MySQL functions. Which trick the beginners to use the functions as they are on Stack Overflow.
This has already been discussed here and comments are made below to warn users about the deprecation, but still some users practice the methods of accepted answers which follow bad practices.
We don't want beginners to make these big mistakes, we are SO and Stack Overflow is a wiki so it should be updated, not to mislead beginners into using deprecated functions and methods.
I still see people posting questions about the errors and we notice that they are using old MySQL functions that are prone to SQL injections. Although most of the sources are now updated and are new, these old ones need attention and we should do something about them
Feature Request
Can Stack overflow provide a option to mark a warning sign on deprecated accepted answers (or those which are voted highly) so the visitors don't get mislead by the information?