The MAX(id) didn't return anything, i eventually settled for an idea posted
to
SELECT id FROM memodata ORDER BY id DESC
then take the first line value and ignore the rest. Ideally though i want
the last line with the highest id number. I know for a fact that another
INSERT won't happen before the SELECT because they happen immediately one
after the other.
FYI, i'm using MySQL and DBD::mysql if that's any more help.

Many thanks

Dan

"Tore Aursand" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Sun, 26 Oct 2003 06:30:11 +0100, SIMON Cedric wrote:
> > For your  query, try "SELECT MAX(id) FROM table"
> > That works with mysql.
>
> That should "work" with most databases, but what happens if there's a new
> insert between the original insert and the SELECT statement above?
>
> This _could_ be solved by locking the table before the insert, and then
> unlocking it again after you've select the maximum id from the same table.
>
>
> -- 
> Tore Aursand <[EMAIL PROTECTED]>
>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to