RE: [PHP-DB] simple database question

From: Date: Thu, 26 Jul 2001 14:00:31 +0000
Subject: RE: [PHP-DB] simple database question
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-10798@lists.php.net to get a copy of this message
What I usually do is do a SELECT COUNT(user_primary_key_column_name) and count the number of rows - then I'll know what the last autonumber added was. A more accurate way is to do your INSERT statement, then follow it immediately with a SELECT select uid,name,address1,phone from users where name = '$name', address1 = '$address1', phone = '$phone' or whatever then you can retrieve the value of uid for your address INSERT. hth Dave currently been here 16 hours...and counting ZZZZZzzzzzzzzzz -----Original Message----- From: Brian Weisenthal [mailto:bsw10@cornell.edu] Sent: 26 July 2001 14:53 To: php-db@lists.php.net 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: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#10798) next »