Thanks Mike. Now if I could only figure out how to use it with my code.

It looks a little harder than I had thought. I was under the impression that I could use standard sql for this.
I probably should have mentioned in my first post but it slipped my mind so I'll ask now.
What I have are about 4 inserts that need need to happen at the same time using a transaction. I am having a major problem with my php code and the transaction playing "nice".
Table A
Table B
Table C
Table D
Table A is the parent and B, C and D are the children. I need to get the surrogate from table A by way of a php function that will grab the last auto-inc. value from table A to insert FKs into tables B C and D. The problem is, when I use BEGIN to start the transaction I can't get the id value from table A because A has not yet been committed.
I believe that a sproc would help me out with this but I don't know how to implement it.
Can I use the code you provided to do this with? I know of course that it would need to be modified to suite my needs but is that code for mysql?
EDIT: Would a function help me in lieu of a sproc?