RE: [PHP] newbie: mysql statement

2002-07-15 Thread Vail, Warren
fford; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] newbie: mysql statement Shouldn't this be "UPDATE header SET parent='$this->parent' WHERE posted = max(posted)" Otherwise the max(posted) = max(posted) is true for all records (therefore all records get

Re: [PHP] newbie: mysql statement

2002-07-15 Thread Martin Clifford
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, July 15, 2002 8:11 PM Subject: Re: [PHP] newbie: mysql statement I would rewrite the query as: "UPDATE header SET parent='$this->parent' WHERE max(posted) = max(posted)" -- PHP General Mailing List (h

Re: [PHP] newbie: mysql statement

2002-07-15 Thread Andrew Brampton
;[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, July 15, 2002 8:11 PM Subject: Re: [PHP] newbie: mysql statement I would rewrite the query as: "UPDATE header SET parent='$this->parent' WHERE max(posted) = max(posted)"

RE: [PHP] newbie: mysql statement

2002-07-15 Thread Vail, Warren
1:56 AM To: [EMAIL PROTECTED] Subject: [PHP] newbie: mysql statement I want to update the most recent record (based on the timestamp in field posted) where the parent field == a specified value (in a table called header). I tried the following mysql statement: "UPDATE header WHERE parent = &

Re: [PHP] newbie: mysql statement

2002-07-15 Thread Martin Clifford
I would rewrite the query as: "UPDATE header SET parent='$this->parent' WHERE max(posted) = max(posted)" I would think this to work, though I don't have the facilities to test it, and have never needed to do a query such as this. In theory, it should update ONLY the row where the maximum valu

RE: [PHP] newbie: mysql statement

2002-07-15 Thread Vail, Warren
5 Fremont 02-658 -Original Message- From: Alexander Ross [mailto:[EMAIL PROTECTED]] Sent: Monday, July 15, 2002 11:56 AM To: [EMAIL PROTECTED] Subject: [PHP] newbie: mysql statement I want to update the most recent record (based on the timestamp in field posted) where the parent f

Re: [PHP] newbie: mysql statement

2002-07-15 Thread Greg Donald
On Mon, 15 Jul 2002, Alexander Ross wrote: >I want to update the most recent record (based on the timestamp in field >posted) where the parent field == a specified value (in a table called >header). > >I tried the following mysql statement: > >"UPDATE header WHERE parent = '$this->postid' ORDER b

RE: [PHP] newbie: mysql statement

2002-07-15 Thread Vail, Warren
MAIL PROTECTED] Subject: [PHP] newbie: mysql statement I want to update the most recent record (based on the timestamp in field posted) where the parent field == a specified value (in a table called header). I tried the following mysql statement: "UPDATE header WHERE parent = '$this->

[PHP] newbie: mysql statement

2002-07-15 Thread Alexander Ross
I want to update the most recent record (based on the timestamp in field posted) where the parent field == a specified value (in a table called header). I tried the following mysql statement: "UPDATE header WHERE parent = '$this->postid' ORDER by posted SET parent='$this->parent' LIMIT1"; but a