Hi everyone,
I have narrowed this down a bit more. I apologize if some of this is a restatement from what I posted previously.
I have narrowed this down to one more level.
This code works fine by itself in between the <?php and ?> tags:
$isbn = $_GET['isbn'];
$sql = "DELETE FROM lounge WHERE isbn = $isbn";
$db->query($sql);
print $sql;
The code does not work and gives me a "DB Error: syntax error" when I place it inside of an if statement like this:
if ($_POST['yes_no'] == 'yes') {
$isbn = $_GET['isbn'];
$sql = "DELETE FROM lounge WHERE isbn = $isbn";
$db->query($sql);
print $sql;
} else {
print "Record not deleted";
}
Is this common? Does anyone know why this won't work?
Thanks!