Quote:
Originally Posted by stevenryals
Sorry i know this is noob stuff.. but i'm in the learning phase here
I have:
Code:
$tagval = $_POST['tagval'];
$cpmval = $_POST['cpmval'];
if (!mysql_connect($db_host, $db_user, $db_pwd))
die("Can't connect to database");
if (!mysql_select_db($database))
die("Can't select database");
$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());
}
it's erroring.. says: "unknown collumn 'steven' in where clause.
the tagval i'm sending is "steven-slist" so it's obviously coming from there somehow..
I thought this was because $tag was being sent, $tag was being retried by POST and then tag was the name of the collumn.. so i changed that variable to $tagval and it's still the same..
|
Notice my amendments in bold. Try that and see how it goes.
It's important, for security, to use that function every single time you put user input into an SQL query.