Jump to content

Question regarding auto_increment ID and reference tables


DeX

Recommended Posts

Hi guys, I have a system that does quotes for jobs for customers. The user inputs a customer's information and then the options they want on their building and it stores the quote in the database into a quote table. I have some questions regarding the best way to do this:

1. Should I enter the customer ID into the quote table or enter the quote ID into the customer table for reference?

2. Either way, how do I get that ID to enter into the reference table? I have the primary key ID set to auto_increment for both tables, how do I know what the ID is going to be so I can store it in the other table?

3. What's the best way to perform both of these SQL statements but not commit them until everything is okay?

 

Thanks.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.