tngo una formula donde antes de insertar necesito saber si existe en la BD un comercio con el mismo nombre, yo lo hago asi:
$checkcTitle = mysql_query("select * from comercials were cTitle=".$title."");
if (!$checkcTitle)
echo "could not execute query";
if (mysql_num_rows($result)>0)
return "that Comercial Name (".$title.")is taken -go back and chose another one.";
aqui el insert.
}else{
echo " <script>document.location.href='/php/error.php?err=0'</script>";
//echo $query;
}
} // insertar
Pero me manda este error:
could not execute query
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /bdb3.php on line 70
qué pasa?
gracias!