2021-08-11, 10:55 AM
I trying to handle SQL error for duplicate "name, surname" rows. Instead of error I need to redirect the user to other site. Is it possible?
My example that doesn't work:
My example that doesn't work:
$query = $db->query("INSERT INTO roleplay_characters(userid, name, surname, weight, height, birthdate, sex) VALUES (".$mybb->user['uid'].", '".$db->escape_string($c_name)."', '".$db->escape_string($c_surname)."', ".$c_weight.", ".$c_height.", ".$c_birthdate.", '".$c_sex."')");
$theError = $db->error_number();
if($theError == 1062)
{
echo("error");
}