Re: newbie: mysql statement
| From: | Martin Clifford | Date: | Mon, 15 Jul 2002 19:24:17 +0000 |
| Subject: | Re: newbie: mysql statement | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-107747@lists.php.net to get a copy of this message | ||
You're right Andrew, got a little ahead of myself :o)
Martin Clifford
Homepage: http://www.completesource.net
Developer's Forums: http://www.completesource.net/forums/
>>> "Andrew Brampton" <andrew@bramp.freeserve.co.uk> 07/15/02 03:23PM
>>> >>>
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