title: Mysql database retrieve multiple rows
body: <p>I use a mysql database.  When I run my query I want to be able to put each row that is returned into a new variable.  I dont know how to do this.</p>
  
  <p>my current code: </p>
  
  <pre><code>&lt;?php
  $result=mysql_query("SELECT * FROM table WHERE var='$var'");
  
  $check_num_rows=mysql_num_rows($result);
  while ($row = mysql_fetch_assoc($result))
  {
  
  $solution=$row['solution'];
  }
  ?&gt;
  </code></pre>
  
  <p>The thing is that check num rows can return a row of an integer 0-infinity.  If there are more solutions in the database how can I assign them all a variable.  The above code works fine for 1 solution, but what if there are more? Thanks.</p>