I am having trouble using user variables inside of a transaction. My problem is I want to insert into a table pull the auto_id (along with other fields)from that insert in another query and store that in a user variable, then use that variable in the next insert into another table. When I commit the transaction I am getting that my user variables are NULL. Anyone have any suggestions on what I can do about this?? I am using mysql 4.0.13 using Innodb tables and PEAR objects to access the database. Here is a small example of what i am trying to do.
start transaction;
INSERT ()......
select @id:=LAST_INSERT_ID(),@field1:=user;
insert (id,user) values (@id,@);
commit;