title: Dynamically Apend data in html table from mysql using php
body: <p>I have mysql table with following columns :</p>
  
  <blockquote>
    <p>no, name, oname, quantity</p>
  </blockquote>
  
  <p>I have n number of records in the tables ,I want to fetch these records in an html table that dynamically increases'decreases its row length according to the number of rows in mysql database. I am trying following but its not working.can anyone help me out here </p>
  
  <pre><code>&lt;?php
  include './connection.php';
  
  $query = "select * from orderdetails";
  $result = mysql_query($query);
  
  echo '&lt;table border="1" style="width:600px" align=center &gt;';
  echo '&lt;tr bgcolor="lavendar"&gt;';
  echo '&lt;td width="15%"&gt;Order No.&lt;/td&gt;';
  echo '&lt;td&gt;Name&lt;/td&gt;';       
  echo '&lt;td&gt;Order&lt;/td&gt;';
  echo '&lt;td&gt;Quantity&lt;/td&gt;';
  echo '&lt;/tr&gt;';
  echo '&lt;/table&gt;';
  
  while( $row = mysql_fetch_assoc($result)){
     echo '&lt;tr&gt;';
     echo '&lt;td&gt;' row['no'] '&lt;/td&gt;';
     echo '&lt;td&gt;' row['name'] '&lt;/td&gt;';
     echo '&lt;td&gt;' row['oname'] '&lt;/td&gt;';
     echo '&lt;td&gt;' row['quantity'] '&lt;/td&gt;';
     echo '&lt;/tr&gt;';
  }
  echo '&lt;/table&gt;';
  ?&gt;
  </code></pre>