I have a code fragment that looks at a registration form and compares a field (steamkey) to a table with serial numbers (field name steamkey) to see if the steamkey is found in the table.
If it is, then the registration form completes. If not, then it fails and the user is sent to purchase a key.
Here is the code fragment that works on the registration page:
Return True = success and the registration completes
$strSQLExists = "select * from table_keys where steamkey='" . $values["steamkey"] . "'";
$rsExists = db_query($strSQLExists,$conn);
// if record exists do something
$message = "Steam Key " . $values["steamkey"] . " already exists."
// if dont exist do something else
Return False = fail
I checked the query with PhpMyAdmin and it works 100%, so I need to know why this is not working. Is it my syntax?
I would appreciate anyone's input.