re: problem with last_id

2003-01-13 Thread Egor Egorov
On Monday 13 January 2003 13:50, Richard Brenner wrote: > I use an application where users can post messages. The messages are stored > in two tables that are related by the id of the new created message. I get > the last id with the following query: "select max(id) as maxid from > tasker_app" > T

Re: problem with last_id

2003-01-13 Thread Gelu Gogancea
Hi, IMHO: I think you should try : 1) SET @a:=0; LOCK TABLE your_table_name WRITE; INSERT what_client_must_to_insert SELECT @a:=MAX(ID) FROM tableetc UNLOCK TABLE; After unlock the table you can find the value of variable @a by doing: SELECT @a; 2) INSERT what_cl

Re: problem with last_id

2003-01-13 Thread Roger Baklund
* Richard Brenner > I have a problem with a query: > > I use an application where users can post messages. The messages > are stored > in two tables that are related by the id of the new created message. I get > the last id with the following query: "select max(id) as maxid from > tasker_app" Oops