When executing the code below, I am getting the error: Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given. From my understanding this would imply that mysql_query is returning false meaning the query is failing but I am not sure why.. Any ideas?
<?php
include 'global.php';
$case=$_GET['case'];
$query=" SELECT * FROM cases WHERE case='$case'";
$result=mysql_query($query);
$num=mysql_num_rows($result);
mysql_close();
$i=0;
while ($i < $num) {
$first=mysql_result($result,$i,"sm_firstname");
$last=mysql_result($result,$i,"sm_lastname");
?>