Imagine the following php+mysql scenario:

there are two tables:
create table testuser(id int not null auto_increment, name varchar(255),
primary key(id));
create table testaddress(id int not null auto_increment, user int not
null,street varchar(255), primary key(id));

the *.php test script contains the following lines:
mysql_query("insert into testuser (name) ('testname')");
//<--* (see below)
$userid = mysql_insert_id();
mysql_query("insert into testaddress(user,street)

* at this time another thread could insert another record into testuser

and the logical question: Will I get the right $userid from
mysql_insert_id() anyway ??

thanx - rené

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