title: PHP get data from database, and use it outside while loop
body: <pre><code>&lt;?php   
  $q=select * from students where (dynamic for user searching)   
  $qry=mysql_fetch_array($q);   
  while($row=mysql_fetch_array())   
  {   
     **// i do not need data here?**   
  }   
  ?&gt;   
  &lt; table&gt;   
  &lt; tr&gt;&lt; td&gt;&lt;?php echo **$row[?][?];** ?&gt;&lt; /td&gt;&lt; td&gt;&lt;?php echo **$row[?][?];** ?&gt;&lt; /td&gt;...&lt; /tr&gt;   
  &lt; tr&gt;&lt; td&gt;&lt;?php echo **$row[?][?];** ?&gt;&lt; /td&gt;&lt; td&gt;&lt;?php echo **$row[?][?];** ?&gt;&lt; /td&gt;...&lt; /tr&gt;   
  ....    
  &lt; /table&gt; 
  </code></pre>
  
  <p>In need to generate a dynamic report in html table format
  the html table rows and columns are static for results
  so i cant use echo with in while loop
  i have to access it out side while loop
  i have an idea of selecting single row single column for each cell of table separatly
  but it will be time consuming and length
  any alternative or solution?</p>