|
Posted by Dikkie Dik on 03/03/07 18:07
> I have 2 statements that I'd like to string together in a query, but
> according to everything I'm seeing, it's not possible.
> What I'm doing is an insert of a row, where the primary key is an auto
> increment. I want to retrieve that by using LAST_INSERT_ID(). I
> tried sending another query after the first (once I knew that it the
> data was what I need) but it didn't return anything. It seems that
> that function can't be used in separate calls or something. Either
> that or there's a setting that I need to check. Any ideas?
It is already suggested that you post the queries themselves. But it
could be something else: If you issue the queries in separate
connections, they will not work together. A connection in MySQL (I
assume you are using MySQL) is like a session: variables only exist
within that session and the result of LAST_INSERT_ID is also not visible
to other connections.
So you do issue the queries in one connection, I hope?
Best regards
Navigation:
[Reply to this message]
|