I have a check function:
function checkCandidateEmail($email)
{
$email = $_POST;
if($email)
{
$candemail = (SQL);
if(isset($candemail['email']))
{
return TRUE;
} else {
return FALSE;
}
return $canEmailCheck;
}
}
I have started to create a function but I am getting NULL
Please, elaborate more on your questions next time. I am not sure what you attempt to compare, if the $_POST with the SQL query or the argument passed with the SQL query. I assume the former.
If the email from that SQL table row equals the submitted email, returns TRUE. Else, returns FALSE. Really simplified version. Now it also checks if the user provided an email:
If an argument is passed, compares that against the database. If none is passed, compares the submitted $_POST[’email’] against the database.
NOTE: In both cases you have to substitute
SQLfor the right string and function depending on your database.NOTE 2: Make sure that your query returns an email, as this simple code does not check if both strings are empty.