What's the standard methodology for locking a series of queries? For example, I obtain some customer info via a PHP form and am ready to insert it. I need to do so into several tables ( customer, address, phone ) which are linked via standard normalization rules.
In this case (slightly de-normalized), the customer table contains fields for phone_id and address_id. As I insert the phone record and retrieve the id, I need to make sure that threads haven't crossed and that I have actually retrieved the same id that I just entered.
I'd like to know how most people are handling that scenario using PHP 4.1.1 and MySQL 3.23.
Any advice and/or insight is appreciated.