-6

mysql_query is not accepted anymore as a way to query databases. However a lot of new developers are still using it and every question that has mysql_query in his example code will get a ton of comments regarding the use of this piece of old code.

I think putting up a warning message on the question page would be a good way to inform the asker he is using old (not recommended) code and keep the comment section clean.

5
  • 2
    That's just not the way SO works, compare to this Q+A. You can edit the tag wiki and add alerts. Commented Jun 29, 2015 at 9:49
  • I understand what you are saying but I think that mysql_query is kinda unique in this way, because it does not invalidate the question itself. The use of mysql_query is almost never the cause of the problem
    – AgeDeO
    Commented Jun 29, 2015 at 10:05
  • 1
  • 1
    What happens if some other language comes out with a mysql_query function or if someone writes there own? Do you want them to get a warning that has nothing to do with them? Commented Jun 29, 2015 at 13:01
  • This isn't a bad idea - it's certainly understandable where it comes from. But the general consensus is against it, always has been.
    – Pekka
    Commented Jun 29, 2015 at 13:16

2 Answers 2

2

Automated systems should not try to judge the technical merit of a post.

It is up to the community to judge the technical merit of a posting. There may be a flurry of comments saying "use mysqli_*, not mysql_*", but eventually one of them will be the most upvoted comment and the others can be removed as obsolete.

Letting an automated system do this means that SO shifts from a place that tries to give you answers, to a system that tries to give technical support (and probably doing so poorly, if keywords trigger the "helpful" advice).

So, I can see where you're coming from, but I'm afraid that in this case, the proposed solution is worse than the problem.

0

I don't see the effort of doing this as it's only correspondated to the php/mysql functions which are a part of SO but far not in almost every question (even if php is the forth most used tag according to the tag overview page).

Therefor I see two problems which are outside of SO:

  1. An uncountable amount of PHP-Tutorials out on the internet are far outdated and use the mysql functions. And they won't be updated and changed to msqli. So every new user who learns PHP and writing his/her first database scripts will have it because it's in the tutorials (s)he read.
  2. As I know from my own freetime project I'm in - there are a lot of old websites still using the old deprecated functions. And I saw many php/mysql questions where some guys taking over old source code and should add new features. Sure you can (and maybe should) refactor things like that but the time you have to effort must be "billed". In our project which has a lot of old functions we have decided to not change the running scripts but we also started rewriting new features with a framework in background to get rid of them in the long term.

As written that I would still prefer the comment for the user. Even the adding of tags like the obsolote tag in the, by Hans Passant, linked question is not a useful way to go in my opinion because the (mostly new) users will notice comments much more intensive than an edited tag - escpecially if the question has formatting / spelling problems and is edited anyway and not because of adding an obsolte or deprecated tag.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .