Im trying to code a smilple downloads page and i am getting a MySQL error that i dont understand can someone help me out, my code is this: (please note the database is connected to threw $conn) [code]<? $content = '<br><center><img src="images/downloads.jpg"><br>'; $query = 'SELECT Did,title,name,hits,version,homepage FROM `downloads` WHERE CatID = \'rat\' LIMIT 0, 30'; $result = mysql_query($query, $conn) or die(mysql_error()); $num = mysql_num_rows($result); echo $result; if($num == "0") { $content .= "<br><p align=\"center\">There are no downloads for this category yet"; $content .= "<br>[ <a href=\"downloads.php\">Click Here to go back to the main downloads page</a> ]</p>"; $content .= "<br><br><br><br>"; // ******NEED TO ASK NABZ ABOUT THE ALL SITE LOGIN******* //if($useradd == "true" && is_user()) { //$content .= "<a href=\"downloads.php?cat=vir_worms&op=add\">Click here</a> to submit a file"; //} } else { echo '<table width="410" height="271" border="0" cellpadding="1" cellspacing="1">'; echo '<tr>'; $count = 0; while(list($Did, $title, $name, $hits, $version, $homepage) = mysql_fetch_array($query)) { echo $name."<br>"; if($cont == "1") { echo '<td width="46"> </td>'; } if ($count == "2") { echo '</tr> <tr>'; $count = 0; } echo"<td width=\"177\" height=\"90\"><div align=\"center\"><b style=\"text-align: center\">$name</b><br> <style type=\"text/css\"><!-- text-align: left; --></style></style><b>Version:</b> $version<br> <b>Downloads:</b> $hits<br> <b>Homepage:</b> $homepage/div></td>"; $count++; } echo '</table>'; } //----------[ DO NOT EDIT ]---------------------------------------------- $template->assign_vars(array( 'CONTENT' => $content, 'DATES' => '2006-2007') ); $template->pparse('body'); ?> [/code] the error i am getting is: Resource id #7 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in rats.php on line 19