I am trying to stop mysql_query output from my form. Currently, if the location is not found, I get an error
"Warning: mysql_result () [function.mysql-result]: cannot go to row 0 in MySQL 11 result index"
I am trying to catch this error and instead assign the variable $ location, which was not found. My code for trying this below is what am I doing wrong?
Thank!
$query3 = "SELECT `location` FROM location WHERE vin = '$vin' LIMIT 1";
$result3 = mysql_query($query3);
if (!mysql_result($result3,0)) {
$location = "Not found";
} else $location = mysql_result($result3,0,0);
source
share