RE: [PHP] newbie: mysql statement

From: Date: Mon, 15 Jul 2002 19:28:53 +0000
Subject: RE: [PHP] newbie: mysql statement
Groups: php.general 
Request: Send a blank email to php-general+get-107748@lists.php.net to get a copy of this message
I like this form better but it's not clear to me if this would only update the row for parent='$this->parent' if it were the last row "posted" to the table. Depends on whether the max function in the where clause is bound to the max in the table or the max in the sequence set (I tend to think it might be max in the table). Warren Vail Tools, Metrics & Quality Processes (415) 667-7814 Pager (877) 774-9891 215 Fremont 02-658 -----Original Message----- From: Andrew Brampton [mailto:andrew@bramp.freeserve.co.uk] Sent: Monday, July 15, 2002 12:23 PM To: Martin Clifford; alexross@bleen.net; php-general@lists.php.net 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 updated) Andrew ----- Original Message ----- From: "Martin Clifford" <MLC1@nrc.gov> To: <alexross@bleen.net>; <php-general@lists.php.net> 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 (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#107748) next »