I have a function in my website meant to check if a user is blacklisted. The last part of it goes as:
$telefon = $_POST['tel_client'];
$numebl = $_POST['nume_client'];
$blacklist_res = mysql_query("Select * from blacklist where telefon_blacklist = ".$telefon." OR nume_blacklist = ".$numebl."") or die(mysql_error());
$blacklist_row = mysql_fetch_array($blacklist_res);
$blacklist_count = mysql_num_rows($blacklist_res);
if ($blacklist_count > 0) { echo
"<div class='alert alert-danger'>Warning: This client is blacklisted for : ".$blacklist_row['motiv_blacklist']."</div>";
}
ERROR I GET IS:
Unknown column 'smith' in 'where clause' // smith is actually the data I add as name taken from the $_POST['nume_client'];
If I run the query only with the check of the number of the client, it works.
$blacklist_res = mysql_query("Select * from blacklist where telefon_blacklist = ".$telefon."")
So the problem might be after I include to check if the name of the client is also blacklisted. Any help is appreciated.