NYCPHP Meetup

NYPHP.org

[nycphp-talk] parse error

John Lacey jlacey at ix.netcom.com
Thu Jun 12 17:56:36 EDT 2003


well, if you didn't cut and paste the code, there's a missing semicolon
at the end of the
$_POST['id'] = $id
statement...


----- Original Message -----
From: "Tim Toomey" <ttoomey at ydnt.com>
To: "NYPHP Talk" <talk at nyphp.org>
Sent: Thursday, June 12, 2003 3:42 PM
Subject: [nycphp-talk] parse error


I'm having trouble with this simple little script I have to delete a row
from mysql. Users click on the delete link, then have a chance to make
sure they want to delete the row and if they click the "yes" radio it
executes this portion of the script:

if (isset($_POST['delete_yes'])) {
$_POST['id'] = $id
$delete_query = "DELETE * FROM products WHERE id = '$id'";
$do_delete_query = mysql_query($delete_query) or die(mysql_error());
echo ("Successfully deleted product.<BR><BR>");
echo ("<a href='index.php'>Return to Product DB Admin.</a>");
}

the $_POST['id'] is just a hidden field that grabs the id from the get
variable ID. This looks a little odd to me, but I still can't understand
why it won't work

I've tried changing the $delete_query to
$delete_query = DELETE * FROM products WHERE id = $_POST['id']; but then
I get T_Variable parse errors.

Anyone know how to fix this?

-timmy


--- Unsubscribe at http://nyphp.org/list/ ---






More information about the talk mailing list