Compare variable from submitted form

wxdqz

New Member
I wanted to compare if a name in a field is already in used by a user.
I have a problem executing this code. Are these correct? Please check.

$insert_data = "INSERT INTO personnel SET " .

//Compare firsname/lastname with submitted //$first_name/$last_name

if(("firstname" == '$first_name') AND ("lastname"=='$last_name'))
{
echo "Sorry someone got that name already!";
exit();
}

//Insert to table:
"firstname = '$first_name', ".
"lastname = '$last_name',".
"nick = '$nick',".
"email = '$email',".
"telephone = '$telephone'";
 
Back
Top