NYCPHP Meetup

NYPHP.org

[nycphp-talk] parse error

Nasir Zubair lists at ny-tech.net
Thu Jun 12 18:20:44 EDT 2003


I believe your your $_POST['id']=$id; line is incorrect. Should you not be
getting data into $id from $_POST? i.e.
 
$id = $_POST['id']; 
 
-------Original Message-------
 
From: talk at nyphp.org
Date: Thursday, June 12, 2003 5:42:21 PM
To: NYPHP Talk
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