Re: Multiple Statements in a query
- From: Ivan Marsh <annoyed@xxxxxxx>
- Date: Fri, 02 Mar 2007 13:51:23 -0600
On Fri, 02 Mar 2007 11:28:02 -0800, paladin.rithe@xxxxxxxxx wrote:
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?
If you're trying to return the last inserted row on a table with an auto
increment field all you have to do is query the maximum value in that
field.
.
- Follow-Ups:
- Re: Multiple Statements in a query
- From: Jerry Stuckle
- Re: Multiple Statements in a query
- From: Michael Fesser
- Re: Multiple Statements in a query
- References:
- Multiple Statements in a query
- From: paladin.rithe@xxxxxxxxx
- Multiple Statements in a query
- Prev by Date: Multiple Statements in a query
- Next by Date: mod_authn_db alternatives
- Previous by thread: Multiple Statements in a query
- Next by thread: Re: Multiple Statements in a query
- Index(es):
Relevant Pages
|