Reply to PHP, MySQL, $_GET and If statement problem

Your name:

Reply:


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!

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация