I have a MySQL query that goes as follows (using Zend_Db):
$sql = $handle->quoteInto("UPDATE board SET rank=rank+1 WHERE post_id=?", $postid);
$handle->query($sql);
(Rank isn't an auto-incrementing PK).
I would like to now retrieve the value of rank
without preforming another query.
I've tried $handle->lastInsertId();
but it doesn't seem to work , since I didn't use MySQL's natural auto-incrementing method (I can't - rank
is the rank of a post. I either ++ or -- it.)
Any way to do this with preforming another query? A function that will return the last changed value?