How do I find second highest value from a table?
<?php
$query = mysql_query("SELECT number FROM table ORDER BY number DESC LIMIT 2");
$second_highest = mysql_result($query,1,0);
echo "the answer to your question is $second_highest";
?>
And that's really all that there is to it... thanks for submitting your question!
Comment on this Question and Answer >>>
ASK A QUESTION
More mysql PHP Questions
How do I return a random row from the database?how to write sessions in php code?
How do I insert the date into my table?
how can I show an image from mysql?
How do I update the contents of a table row?
