23

I found a question today when I was looking for duplicate targets. I found this question MySQLi query to loop through array and update multiple rows.

When I saw the accepted answer I decided to edit it into shape, but I was not happy since the question was clearly asking how to do it using mysqli, but the answer was given in PDO. I scrolled further down and saw four answers of horrible quality, which I downvoted and voted to delete. Before adding the correct answer I noticed that an answer that was the most downvoted was the exact answer I wanted to add. This answer has already two delete votes. I don't really understand why.

What can I do about it? Should I repost that answer as CW when it gets deleted? Should I add my own delete vote and then repost as CW? Is there a way to save this answer?

21
  • 19
    If you think the answer is correct, upvote it. Positively scored answers can only be deleted by moderators. Commented Apr 11, 2021 at 20:33
  • 11
    @RobertLongson I have upvoted it, but this will not balance the 6 downvotes it has
    – Dharman Mod
    Commented Apr 11, 2021 at 20:39
  • 1
    Why it is downvoted... I have no idea... I have some of my answers revenge downvoted, sometimes those votes go on my least voted posts... like they will be less suspicious...
    – Dalija Prasnikar Mod
    Commented Apr 11, 2021 at 21:38
  • 17
    Seems odd that it's been sitting there for 5 years and then today 2 delete votes come in on it. Are users suppose to delete correct Answers? I was under the impression that only harmful or redundant Answers were to be deleted.
    – Scratte
    Commented Apr 11, 2021 at 21:39
  • 16
    Well, the answers author has a rather unique history on SO (and meta specifically). I'm sure that could have played a role. But you also have an answer with no explanation and a link to another SO question. Maybe the delete voters didn't bother to check the link and just assumed it was a dup and should have been closed as a dupe? Commented Apr 11, 2021 at 21:50
  • 8
    Maybe the lack of clear explanation given in the answer itself as to why the answer is "The only proper answer:" - I can imagine some people might try other answers and see that they appear to work and are simpler, and may also not bother clicking through on the link on SQL injection Commented Apr 12, 2021 at 6:46
  • 16
    The meta effect took care of the issue. However starting an answer with "the only proper answer..." is generally unnecessary. The votes are a much better indicator what is or isn't a proper answer, even if there are exceptions. Commented Apr 12, 2021 at 9:01
  • 8
    The answer has even been better worded by the OP now, so seems like a win-win.
    – Thom A
    Commented Apr 12, 2021 at 10:10
  • 5
    @maytham Yours is the accepted answer, which is what you get for writing an answer that the OP approves of. You don't get a guaranteed vote ratio.
    – khelwood
    Commented Apr 12, 2021 at 12:05
  • 3
    The guy was under suspension for a year, few years ago. And I heard few people complaining about his behavior that time. May be those're revenge downvotes, as suggested by @DalijaPrasnikar
    – Sagar V
    Commented Apr 12, 2021 at 12:17
  • 5
    @maytham-ɯɐɥʇʎɐɯ I don't know what you take personally. Nobody is targetting you. This question has gotten more visibility because of this meta post, which causes your answer to get downvotes. This is not personal. Your answer is not bad, it is just not in the right place. This is exactly what the downvotes say.
    – Dharman Mod
    Commented Apr 12, 2021 at 17:23
  • 7
    @maytham-ɯɐɥʇʎɐɯ it has a positive score and an acceptance tick. Obviously people like it.
    – OrangeDog
    Commented Apr 12, 2021 at 22:48
  • 7
    Yeah I don't know. Even if the accepted answer uses the wrong technology, anyone who is not completely oblivious can see that answer and smack their own forehead wondering why they didn't realise to use a loop themselves and adapt the code to their own situation. It isn't exactly a rocket science case. I am not going to split those answers into correct and incorrect, Your Common Sense's answer is simply more correct.
    – Gimby
    Commented Apr 13, 2021 at 8:36
  • 6
    @maytham-ɯɐɥʇʎɐɯ actually, Dharman is a huge advocate of PDO himself. I would say that adding a short preface saying that PDO in many aspects is better than mysqli and hence offer the solution based on this driver, would make a perfect answer. Being accepted, it will encourage readers to consider PDO. Commented Apr 14, 2021 at 8:01
  • 3
    @maytham-ɯɐɥʇʎɐɯ Yeah, very good but it was too verbose. I improved it and fixed grammar mistakes
    – Dharman Mod
    Commented Apr 14, 2021 at 10:46

1 Answer 1

3

Stack Overflow finally is discussing about these? When people asks "how to solve X with Y", they don't really care what Y is, just solving X. We had the same problem over Unix & Linux. People were asking "remove line containing string with grep" to then accept using an answer using sed, "sum columns using perl" to then accept an answer using awk, and every other iteration with cat, perl, python, awk, sed, grep, tr, etc. the whole shebang. What we discovered is that users don't care which tool are required to solve the problem, as long as it solves the problem. For those kinds of questions where people were processing text, reading and manipulating files that use plain text, we created a tag: text-processing. If the askers has a hard requirement of what tool they need to use, we just remove any indication of tool and leave the bare question.

This is the same situation. The user didn't really care what it has to use to get their problem solved, instead they wanted to solve it. These are a lesser example of an XY problem. In this case, OP thinks Y should be used to solve the problem, but unlike the worst XY questions, they plainly state what their X is.

That particular answer tried to follow OP instructions to the T, and that is the reason why is getting penalized. In those cases I just remove Y from the question and just leave the core issue: updating rows in a database with the values of a PHP array.

1
  • Yeah, the number of times I've found the "perfect" question for my needs, and all of the answers solve the problem but don't actually answer the stated question has irked me recently. What should I do next? Most advice I have been given is to answer the question myself (which defeats the point that I'm looking for help) or to ask a new question, which will probably just be marked as a duplicate...
    – Troyseph
    Commented Apr 29, 2021 at 14:07

You must log in to answer this question.

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