Basicly I have an Register Page where you can register an Account for a Game with an Serial Key. Im checking if the Key that got typed in is in the Database.
$keyquery = mysql_query("SELECT * FROM keys WHERE key = '$_POST[key]' AND used = '$used'") or die(mysql_error());
if(!$row = mysql_fetch_array($keyquery) or die(mysql_error()))
{
//key works
}
else
{
//key doesnt work
}
Now if im trying to register an account, I get an error.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'keys WHERE key = '1234' AND used = '0" at line 1