I am trying to figure how to take a number entered in a form and check it against the database
The table name is members and field is acct_num
If they enter an account number in the form and submit it and it dont exist it should come back saying invalid account number otherwise it will go through
I have tried everything i know SHOULD work but no luck. Anyone who can tell me how would be nice.
Here is what I have
Code: Select all
$checkuser = "SELECT acct_num FROM members WHERE acct_num='$payee'"; //$payee is the variable for textbox payee
$query = mysql_query($checkuser);
if ( mysql_num_rows($query) > 0 ) {
$chk=TRUE;
$msg ="Invalid Account Number.";
}