$result = mysql_query("SELECT pin FROM tblGsm WHERE gsmtype ='$gsmtype' AND amount='$amount' LIMIT 1") or exit('Returned Error: '.mysql_error());
echo mysql_num_rows($result)." rows were returned for query 'SELECT pin FROM tblGsm WHERE gsmtype ='$gsmtype' AND amount='$amount' LIMIT 1'<br>";
$pin=mysql_result($result, 0);
mysql_query('DELETE FROM tblGsm WHERE pin='.$pin);
I get:
#1064 - 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 '$result = mysql_query("SELECT pin FROM tblGsm WHERE gsmtype ='$
I think but I'm not sure that you will need to use backticks around your columname pin like so `pin`. IN is a reserved word in mysql, I'm guessing that mysql is thinking you mean:
Code:
SELECT P IN
and thus thinks you have a syntax error because the two are running together.
Bookmarks