1. Have an order_id on the first table (or a separate 
ORDER table) that is INT and AUTO_INCREMENT.
2. Have an order_id on the other table(s) that is INT but 
not AUTO_INCREMENT.
3. Create the record in the first table just inserting the info 
you get in.
4. get the order_id just created using mysql_insert_id().
5. insert the data into the other table(s) with this order_id().

Tim Ward
http://www.chessish.com
mailto:[EMAIL PROTECTED]
----- Original Message ----- 
From: Ashley M. Kirchner <[EMAIL PROTECTED]>
To: PHP-General List <[EMAIL PROTECTED]>
Sent: Tuesday, December 17, 2002 8:15 PM
Subject: [PHP] key pairs


> 
>     I have the following bit of information coming in that I need to 
> generate key pairs of so I can drop it all into a database.  I'm 
> creating tables for each section (SHIP_TO and BILL_TO) with matching 
> Unique_IDs.  What's the best way to go about this (creating the pairs, 
> stripping off excess spaces from some fields that have them after the 
> last character, etc., etc.)
> 
> ---------- data ----------
>   SHIP TO:
>   Business Name:
>   Contact Name:     Ashley Kirchner
>   Day Number:       303 442-6410
>   Evening Number:
>   Fax Number:
>   Address:          3550 Arapahoe Ave., Ste. #6
>   Address:
>   Address:
>   City:             Boulder
>   State/Province:   CO
>   Zip/Postal Code:  80303
>   Country:          USA
>  
>   BILL TO:
>   Business Name:
>   Contact Name:     Ashley M. Kirchner
>   Day Number:       303 4426410
>   Evening Number:
>   Fax Number:       303 442-9010
>   Address:          3550 Arapahoe Avenue
>   Address:          Suite #6
>   Address:
>   City:             Boulder
>   State/Province:   CO
>   Zip/Postal Code:  80303
>   Country:          USA
> ----------
> 
> 
> -- 
> W | I haven't lost my mind; it's backed up on tape somewhere.
>   +--------------------------------------------------------------------
>   Ashley M. Kirchner <mailto:[EMAIL PROTECTED]>   .   303.442.6410 x130
>   IT Director / SysAdmin / WebSmith             .     800.441.3873 x130
>   Photo Craft Laboratories, Inc.            .     3550 Arapahoe Ave. #6
>   http://www.pcraft.com ..... .  .    .       Boulder, CO 80303, U.S.A.
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to