php - How to validate record in database -
what trying check customerid exists in database. if exists order submitted orders table. if customerid not exist, returns error.
trying check customers table see if customerid entered user exists, don't know how this. code below got different thread.
$checkid = "select customerid $tablename customerid = ".($customerid).""; $check_ref = @mysql_query($check2,$connection) or die("couldn't execute check.<br>".mysql_error()); if(mysql_num_rows($check_ref)<1){ $login_err = "the customer number entered not exist."; $error = "1";
okay, here goes:
- your query stored in
$checkid, yet query$check2 - you disable error reporting on
mysql_query. wrong on many levels. - what parens doing around
$customeridin string concatenation?
Comments
Post a Comment