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
the code is running well without errors but y is it that three of the columns in the table do not insert data?How do I return a random row from the database?
How do I update the contents of a table row?
How do I order the results of my query?
How do I find the ID of a new row added to a table?
