|
Posted by mpar612 on 12/17/78 11:55
Hi everyone,
I am having a issue that I have been working on for the last few days.
I am using PHP 5, MySQL 4.1 and PEAR.
The following code works by itself between <?php and ?> tags:
$isbn = $_GET['isbn'];
$sql = "DELETE FROM lounge WHERE isbn = $isbn";
$db->query($sql);
print $sql;
Now, if I put it inside of an If statement, it does not work and I get
a "DB Error: syntax error":
if ($_POST['yes_no'] == 'yes') {
$isbn = $_GET['isbn'];
$sql = "DELETE FROM lounge WHERE isbn = $isbn";
$db->query($sql);
print $sql;
} else {
print "Unable to delete record";
}
This isbn is stored as an INT in MySQL. Does anyone have any ideas? I
would really appreciate any feedback that anyone could give.
Thanks!
Navigation:
[Reply to this message]
|