Re: Help: Transactions not working
| From: | Stuart Felenstein | Date: | Fri, 15 Oct 2004 11:22:28 +0000 |
| Subject: | Re: Help: Transactions not working | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-36821@lists.php.net to get a copy of this message | ||
That made a world of difference! :) Thank you.
But - I want to confirm, am I still using transactions
even though I'm issuing individual query calls for
each insert.
And, if I can ask another question to the list :
In this line (from the second insert)
VALUES (null, LAST_INSERT_ID(), ......)";
The LAST_INSERT_ID works great here, getting the
auto-inc from the first insert, but will it work in
subsequent insertions to other tables.
I ask because in the second insert (shown), the
LAST_INSERT_ID, gets the value from the first table,
but the second table (second insert) also has an
auto-inc column. So I'm thinking then the third
insert will get the LAST_INSERT_ID from table 2 / 2nd
insert.
Perhaps I need to declare it the first time as a value
(app code) or add "where" conditions to all the
subsequent insertions ?
Thank you,
Stuart
--- John Holmes <holmes072000@charter.net> wrote:
> > Am I missing something here ?
>
> Yep... you're missing a mysql_query() call for each
> query. You're only
> running one query and echoing the other...
>