View Single Post
Old 11-12-2012, 04:55 PM   PM User | #8
BluePanther
Senior Coder

 
Join Date: Jul 2011
Posts: 1,226
Thanks: 3
Thanked 171 Times in 171 Posts
BluePanther is on a distinguished road
Quote:
Originally Posted by stevenryals View Post
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());
}
Wait until I can get on a computer.
__________________
Useful function to retrieve difference in times
The best PHP resource
A good PHP FAQ
PLEASE remember to wrap your code in [PHP] tags.
PHP Code:
// Replace this
if(isset($_POST['submitButton']))
// With this
if(!empty($_POST))
// Then check for values/forms. Some IE versions don't send the submit button 
Quote:
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
BluePanther is offline   Reply With Quote