I agree entirely with everything Sam I am has said, although additionally it has to be stated that sometimes it is true the 2nd, 3rd, etc answers are better than the accepted one.
However, @thirtythreeforty, I don't think you've thought it through thoroughly enough. How would you suggest this would be applied with a script?
My suggestion for the heuristic would be at least double the accepted answer's score, and a score of at least twenty. This would prevent close calls for answers with scores close to each others', but still achieve the goal of "best info first."
Votes are not enough
Votes do not always = quality (up/down good/bad).
Sure it's mostly a reflection of this, but "mostly" and "votes alone" are not enough to play around with people's answer positioning. Votes can be given for many reasons, and quality can be determined in a variety of ways:
Grammar, good/bad English, too much/little advice, users rep, small issue that doesn't really matter but community sheep voting says it does...
An accepted answer with 3 upvotes might have answered with "MYSQL_" as per the questioners code, but people upvoted the 2nd answer to 10 votes because it touched on info about MYSQLi_ and PDO...
Which is better? The one which simply answered as needed, or the one with some security advice?
There are many more things that could be reasons, and an automated system cannot possibly to take into account these things when determining which answer was better (well, it could but no-one's going to spend 12 months writing it..).
It is sometimes true
Many times I've seen the accepted answer is no where near as good as the 2nd answer.
I've even seen where the 2nd answer had 100% of the entire text of the accepted answer, but then way more info, and useful such as going into depth about quite important and relevant security issues, or whatever.
However, how can you decide which is the "best" answer with algorithms? Upvote comparison with accepted answer and 2nd one is not enough.
If the accepted answer has 3 up votes, and the 2nd answer has 25 upvotes, your argument is it's likely that the 2nd one is better (in fact way more as you only suggested double). However, consider:
The 2nd answer has 10 paragraphs of description, links, other references, and 25 upvotes, but it's is not as good as the accepted answer with 1 sentence and 3 upvotes simply because the accepted answer contains just enough information.
It being short and to the point is all that was needed and so is a good, and possibly better, answer. The 2nd one, while fantastic the answerer went to trouble to give more info and deserves the 25 upvotes, isn't the best answer as the accepted one simply answered the question as was needed.
Maybe the 2nd answer was better due to touching on something very important missing in the accepted answer, but almost impossible to judge with a script.
Also, even just using votes alone, how do you then compare 3rd, 4th, 5th etc to 2nd and 1st answers?
You likely end up with answers all over the place, out of sync with their vote counts, and while this new ordering could accurately represent the true order of answers based on quality, it would look messy and be confusing.
The way it is, while I agree is not 100% perfect, is the best way given the choices and almost impossible requirements to improve it, and for little gain.
There are way too many decisions to make from the above examples, to determine with a script.