I'm getting the following error when I select a category that I know has products.
Error: SQL: Query was empty
if(!isset($start)) $start = 0;
$queryp=mysql_query("Select * from products where category='$_GET[cat]' AND LIMIT ' . $start . ', 2");
$res=mysql_query($queryp) or die("SQL: $query<br />\nError: ".mysql_error());
while ($rowp=mysql_fetch_array($res)){
echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"10\"><tr><td class=\"body1\" width=\"1%\"><a href='index.php?product=$rowp[id]&category=$rowp[category]'><img src='images/thumbs/$rowp[photo]' border=0></a></td><td class=\"body1\" valign=\"top\"><p class=\"cartheader\">Template Name: <b>$rowp[name]</b></p>
<p>$rowp[description]</p>
<p><strong>Price: <b><font color=red>$rowp[price]</font></b> | <a href='catalog.php?product=$rowp[id]'>Add to Cart</a> | <a href='images/$rowp[photo]' target='_blank'>Enlarge Image</a></strong></p></td>
</tr>
</table>
<hr size=\"1\">";
}
$queryp = "SELECT count(*) as count FROM products";
$res=mysql_query($queryp) or die("SQL: $query<br />\nError: ".mysql_error());
$row = mysql_fetch_array($res);
$numrows = $row['count'];
if($start > 0)
echo "<a href=\"" . $PHP_SELF . "?start=" . ($start - 10) .
"\">Previous</a><BR>\n";
if($numrows > ($start + 10))
echo "<a href=\"" . $PHP_SELF . "?start=" . ($start + 10) .
"\">Next</a><BR>\n";
if (($numrows) == 0) {
echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"10\"><tr class=\"cells\"><td class=\"body1\" colspan=\"6\"><font color=red>No templates found. Please select another search criteria.</font></td></tr></table>";
}