Question about connecting mysql database tables
Posted on 2011-09-15
If I have several tables such as "owner", "property", and "calendar" and lets say the owner table has a field called "record_index" which is an auto-increment type. is it appropriate to use that field to connect a unique owner record to several property records?
Secondly, is there a way when using INSERT INTO owner_table to know what the value of that incremental field after the new row is inserted, based on $result = mysql_query($sql) or do I have to do a search for that record and then use the incremental field value from that search in my insert_into for the "property" table.
That is can I do three insert_into commands in a row and use the incremental field value from the prior insert in the second and third step?
Thanks very much for your help.