Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to show highest value of mysql database in php
    text
    copied!<p>this is mysql table</p> <pre><code>--------------------------------------------- id | date | name | amount --------------------------------------------- 1 | 2013-01-31 | abcd | 200.000 2 | 2013-02-28 | apple | 95.000 3 | 2013-03-31 | bannna | 30.000 4 | 2013-04-30 | computer | 5.000 5 | 2013-05-31 | mobile | 500.000 6 | 2013-06-30 | mouse | 2.000 7 | 2013-07-31 | led tv | 25000.000 --------------------------------------------- </code></pre> <p>how to find highest value amount of this table</p> <p>i want result like this in php page highest amount value 1st</p> <pre><code>Date | Name | Amount 2013-07-31 | LED TV | 25000.000 2013-05-31 | Mobile | 500.000 2013-01-31 | Abcd | 200.000 2013-02-28 | Apple | 95.000 </code></pre> <p>how can i do this please help me to fix this issue thanks</p> <p>i am using this code but it is not showing my type of result.</p> <pre><code>&lt;?php $username = "root"; $password = ""; $hostname = "localhost"; //connection to the database $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); echo "Connected to MySQL&lt;br&gt;"; //select a database to work with $selected = mysql_select_db("car",$dbhandle) or die("Could not select examples"); //execute the SQL query and return records $result = mysql_query("SELECT MAX( amount ) AS amount FROM table5"); //fetch tha data from the database while ($row = mysql_fetch_array($result)) { echo "Date:".$row{'date'}." Name:".$row{'name'}."Amount: ". //display the results $row{'amount'}."&lt;br&gt;"; } //close the connection mysql_close($dbhandle); ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload