You are the right.
Is possible use mysql_insert_id() and it need not stack the queries and
confirm these one by one.
Thanks a lot!!
OKi98 wrote:
> marga wrote:
>
>> Is not possible to use mysql_insert_id() and assing it in a php
>> variable, because
>> mysql_insert_id() is executed after the COM
marga wrote:
Is not possible to use mysql_insert_id() and assing it in a php variable,
because
mysql_insert_id() is executed after the COMMIT, I think.
wrong, it is possible to use mysql_insert_id() during the transaction.
the code should look like this:
mysql_query("start transaction");
if
To accomplish this in the past, it is assumed that the last entered ID is the
highest (since it auto
increments)
To solve this simply, I would use (truncated a bit):
Good luck, let me know if you need any more assistance.
- Nick Stinemates
On Fri, Jan 19, 2007 at 09:38:01AM +1300, Bruce Cow
What about doing all of that in a stored proc and handle the transaction in
there? I've never done that with MySQL (only SQL Server) but I'm assuming it's
possible.
Regards,
Bruce
>>> marga <[EMAIL PROTECTED]> 18/01/2007 10:37:04 p.m. >>>
Hi,
I create a sql variable with php code. Is possib
ct: [PHP-DB] setting SQL variable
Date: Thu, 18 Jan 2007 10:37:04 +0100
Hi,
I create a sql variable with php code. Is possible that it didn't works?
In order to maintain the integrity I open a transaction to do all
inserts. First insert a row in table1. I need these Insert ID
to make the follo
Hi,
I create a sql variable with php code. Is possible that it didn't works?
In order to maintain the integrity I open a transaction to do all
inserts. First insert a row in table1. I need these Insert ID
to make the follow Inserts in the relations tables. Is not possible to use
mysql_insert_id()