View Single Post
Old 11-12-2012, 04:48 PM   PM User | #7
stevenryals
New Coder

 
Join Date: Jul 2012
Posts: 60
Thanks: 4
Thanked 0 Times in 0 Posts
stevenryals is an unknown quantity at this point
Quote:
Originally Posted by BluePanther View Post
Can't see the error on my phone, but make sure the form input names match up to the POST array keys

They do.. here's the error in text:

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 'AND cpm >' at line 1

in the input form:

<input size=10 type=text id=tagval name=tagval>
<input type=text size=2 id=cpmval name=cpmval>

in the action file:

$tagval = mysql_real_escape_string($tagval);
$cpmval = mysql_real_escape_string($cpmval);

DELETE FROM {$table} WHERE tag = $tagval AND cpm > $cpmval

Code:
$tagval = mysql_real_escape_string($tagval);
$cpmval = mysql_real_escape_string($cpmval); 

$sql = mysql_query("DELETE FROM {$table} WHERE tag = $tagval AND cpm > $cpmval " );
if (!$sql) {
    die(mysql_error());
}
stevenryals is offline   Reply With Quote