Following is a question with very special properties:
- Importance: Bad coding style will affect database security and potential hijacking
- Relevance to beginners: This is something that even beginners who write their first working code have to be aware off
- Difficulty of knowing when you have it right: Unless you are attacked, it's pretty difficult to know whether you actually secured against everything. Thus, it is difficult (especially for beginners) to know which answer is correct
Because of these properties, a lot of "semi amateurs", who know some things, but not sufficiently enough, have given answers they deem correct. However, most of them are horribly wrong. But, since those who ask or google the question do not know this, they will upvote any answer that "sounds correct" for them and delivers working code.
How can I prevent SQL injection in PHP?
For example, look at Matt Sheppard's answer. It has many upvotes, but also a negative comment that actually shows the flaws which has a lot upvotes as well.
I believe this is very dangerous and should be adressed somehow - at least brought into the attention of viewers.
The solution of protecting the answer (to anyone below 10 rep) is not really useful, since - as I explained - most of the bad answers come from semi amateurs, who are well above that threshold.
Perhaps there should be another protection level, or a big red warning.