Hi Brian,

Are you using MySQL?  If so, you can use the function mysql_insert_id().

http://www.php.net/manual/en/function.mysql-insert-id.php

That will give you the last id inserted by MySQL which you can use in the
address table.

Josh Hoover
KnowledgeStorm, Inc.
[EMAIL PROTECTED]

Searching for a new IT solution for your company? Need to improve your
product marketing? 
Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can simplify
the process for you.
KnowledgeStorm - Your IT Search Starts Here 

> -----Original Message-----
> From: Brian Weisenthal [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 26, 2001 9:53 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] simple database question
> 
> 
> ok this should be an easy one, i am just blanking on it here.
> 
> i want to link two tables together, a user table and address 
> table. i create
> the user entry first, then create the address entry. after 
> creating the
> address entry how do i get the auto_id that was entered in to 
> enter it into
> the user table? there is no unique field in the address 
> table. any ideas?
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: 
> [EMAIL PROTECTED]
> 

Reply via email to