>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 apparently you can't use ORDER in an UPDATE statement.  If I take order
>out, the statement works.  That being true (and please correct me if its
>not) how can I ensure that the newest record is the one being acted upon?

Perhaps:

where posted = max(posted)

assuming no *TWO* are ever posted within the same second, which is a very
dangerous assumption for a busy site...

Can't you just pass in the ID of the actual header you want changed, instead
of only its parent?

-- 
Like Music?  http://l-i-e.com/artists.htm


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to