I've noticed a number of instances where a user will ask a question regarding PHP and MySQL using the deprecated mysql_
functions, and there will almost always be at least one other user who feels the need to point out that it is deprecated. They're not wrong. However, in my opinion, unless this is the actual cause of the problem the asker is facing, it's not adding anything constructive to the situation at all (and if it is the cause, it should be an answer not a comment).
I have reported these sorts of comments before and if my memory serves me correctly most were subsequently deleted, so I would guess that I am right in reporting them, however I'd just like an official word on it.
Should users be commenting "mysql_
functions are deprecated" on questions or is that considered not constructive? Or to go further, any question that involves a deprecated feature that is not supported but is still functional (such as the HTML tags deprecated in HTML5)?
mysql_*
functions in new code. They are no longer maintained and are officially deprecated. See the red box? Learn about prepared statements instead, and use PDO or MySQLi - this article will help you decide which. If you choose PDO, here is a good tutorial.mysql_
functions are deprecated, just as I am for informing a user if their code is vulnerable to SQL injections like @JamesThorpe. It’s good to point these things out and make as many new (and old) developers aware as possible.