why am i getting this error from my code?
Warning: Supplied argument is not a valid MySQL result resource in c:\Program Files\Apache Group\Apache\htdocs\tastywet\order_func.php on line 32
from the line of code:
$conn = db_connect();
//insert clients address
$query = "select cid from clients where
cmpnyname = '$cmpnyname' fname = '$fname'
and lname = '$lname' and house_no = '$house_no'
and street = '$street' and town = '$town'
and postcode = '$postcode' and email = '$email'
and contact_no = '$contact_no'";
$result = mysql_query($query);
if(mysql_numrows($result)>0)//error is said to be here?
{
$cid = mysql_result($result, 0, "cid");
}
else
{
$query = "insert into clients values
('', '$cmpnyname', '$fname', '$lname', '$house_no',
'$street','$town','$postcode','$email','$contact_no')";
$result = mysql_query($query);
if (!$result)
return false;
}