NYCPHP Meetup

NYPHP.org

[nycphp-talk] parse error

Tim Toomey ttoomey at ydnt.com
Thu Jun 12 20:06:38 EDT 2003


my god, I can't believe it, see I changed that part like 3 times and maybe I
just missed it.

Thing is I get this error after that (and this was happening before as well)
its a mysql error at the first line of my mysql

You have an error in your SQL syntax near '* FROM products WHERE id = '41''
at line 1

it works properly, gets the right number but then I get mysql error
wait, I forgot, I typed in SELECT instead of DELETE

geez its been one of those days.

thanks guys,

-timmy
----- Original Message ----- 
From: "John Lacey" <jlacey at ix.netcom.com>
To: "NYPHP Talk" <talk at nyphp.org>
Sent: Thursday, June 12, 2003 2:56 PM
Subject: Re: [nycphp-talk] parse error


> 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