No, it returns a scalar value representing that last AUTO_INCREMENT value
that was generated for your current server connection.
At 9:11 AM -0500 5/26/99, Sandrine C. wrote:
>Just a question about mysql_insert_db().. I m curious
>how does it work if the primary key is composed of more than one field??
>Does it retunr you an array??
>
>Sandrine
>
>
>>I asked this too once: You're looking for mysql_insert_id() which will
>>return the previously created autoincrement key. I.e.
>>
>> $add_adresses=mysql_query("INSERT INTO adresse VALUES(NULL, ...");
>> $id=mysql_insert_id();
>> $add_other=mysql_query("INSERT INTO other VALUES(NULL, ...,$id,...");
>> $other_id=mysql_insert_id();
>> mysql_query("update adresse set thefield='$other_id' where id='$id'");
>>
>>Hope this is what You need.
>> Erik L.
>>
>>---
>>Erik Liljencrantz, E-ell-Data, http://www.eldata.se
>>erik@stripped, +46 150 250 58, +46 70 51 8 51 26
>>Aspenaes, 640 25 JULITA, SWEDEN
--
Paul DuBois, paul@stripped
Northern League Chronicles: http://www.snake.net/nl/