title: Error: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
body: <p>I got the error "mysql_fetch_array(): supplied argument is not a valid MySQL result resource...". On the lines that concern this mysql query.</p>
  
  <pre><code>$result = mysql_query("select * from chat order by time desc limit 0,10");
  $messages = array();
  
  while($row = mysql_fetch_array($result)){
  
     $messages[] = "&lt;div class='message'&gt;&lt;div class='messagehead'&gt;" . $row[name] . " - " . date('g:i A M, d Y',$row[time]) . "&lt;/div&gt;&lt;div class='messagecontent'&gt;" . $row[message] . "&lt;/div&gt;&lt;/div&gt;";
     //The last posts date
     $old = $row[time];
  }
  //Display the messages in an ascending order, so the newest message will be at the bottom
  for($i=9;$i&gt;=0;$i--){
     echo $messages[$i];
  }
  </code></pre>