Writing to two tables in 1-N relationship.

From: Date: Thu, 20 Sep 2001 13:22:03 +0000
Subject: Writing to two tables in 1-N relationship.
Groups: php.general 
Request: Send a blank email to php-general+get-67973@lists.php.net to get a copy of this message
I have two DB tables that are in a 1 - N relationship. I need to enter data once in the 1-side, and then many times data on the N-side. (For those who like it less abstract: The 1-side is a table with data about a car (frame number, brand + type, and a carrier), the N-side has records about damages found on that car after transport) I'm a little bit confused about how to deal with this: - After every data input, write the stuff away to a temp text file, and when all input is done, write that text file at once to the database. - Store the data in arrays, and pass them on between runs of the script as part of the URL (but I could run out of space?) - A better way that I don't see? One thing is for sure, and that is that the data needs to be written to the DB in one go (so as to be able to use transactions effectively (in PostgreSQL)). Can anyone advice? Someone must have been in this position before. :) I hope I explained the problem ok, I tend to get carried away. Thanks in advance, Alexander Deruwe

« previous php.general (#67973) next »