View Single Post
Old 11-12-2012, 08:36 PM   PM User | #16
BluePanther
Senior Coder

 
Join Date: Jul 2011
Posts: 1,226
Thanks: 3
Thanked 171 Times in 171 Posts
BluePanther is on a distinguished road
Why have you dropped the $_POST superglobal variable assignments? That's how the data is passed from the function. Also, the mysql_real_escape_string() should be after a mysql connection.

PHP Code:
<?php

$db_host 
=  <defined>
$db_user =  <defined>
$db_pwd = <defined>
$database = <defined>
$table =<defined>

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");

$tval mysql_real_escape_string($_POST['tval']);
$cval mysql_real_escape_string($_POST['cval']);

$sql mysql_query("DELETE FROM expedia WHERE `tag`='$tval' AND `cpm`=$cval" );
if (!
$sql) {
    die(
mysql_error());
}



mysql_free_result($result);

?>
__________________
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