title: show the maximum value of a column of mysql table in php?
body: <p>I want to show the maximum value of a particular column of mysql table in php. Here is my code: </p>
  
  <pre><code>  &lt;?php
           mysql_connect("localhost","root","") or die(mysql_error());
           mysql_select_db("database") or die(mysql_error());
  
           $var = $_POST['value'];
           $sql = mysql_query(" SELECT MAX(column) FROM tableName WHERE variable='$var' ") or die(mysql_error());
  
           $row = mysql_fetch_array($sql) or die(mysql_error());
  
           echo "Maximum value is ::  ".$row['column'];
      ?&gt;
  </code></pre>
  
  <p>output:::</p>
  
  <pre><code>    Maximum value is :: 
  </code></pre>