Re: php insert different records into multiple mysql tables with same unique id
What has been said here is dead on, I would add one other thought. On the secondary tables (that have a field populated with the key (call this the prime id) generated for the first table that you used mysql_insert_id() to get the auto incremented key) let those tables have their own unique key, it is useful for doing updates later. Also change the field that contains the generated id(prime key) to be a index for the other tables. This will speed access when you take the prime key from the first table and go to collect the related info from the other tables.
HTH
Clay
|