I like to change my code up a bit and if the int $itemID
does not exist the user should trigger $retval
die
, if $itemID
exists the user should proceed with the update of the db.
What method is most suitable?
code:
$upd = "UPDATE booking SET userID ='$userID' WHERE itemID ='$itemID'";
$retval = mysql_query($upd, $con);
if(!$retval){
die('Could not update data: '.mysql_error());
}
echo "Updated data successfully
";