: ,
. , , .
,
mysql_insert_id() auto_increment feild, .
0, , .
,
- EDIT..
<?php
$link = mysql_connect('localhost', 'root', 'techping');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db('test');
mysql_query("INSERT INTO test (id, name) values (100,'kossu')");
printf("Last inserted record has id %d<br />", mysql_insert_id());
mysql_query("INSERT INTO test (id, name) values (125,'kossu')");
printf("Last inserted record has id %d<br />", mysql_insert_id());
mysql_query("INSERT INTO test (id, name) values (121,'kossu')");
printf("Last inserted record has id %d<br />", mysql_insert_id());
mysql_query("INSERT INTO test (id, name) values ('','kossu')");
printf("Last inserted record has id %d<br />", mysql_insert_id());
mysql_query("INSERT INTO test (id, name) values (250,'kossu')");
printf("Last inserted record has id %d<br />", mysql_insert_id());
?>
:
Last inserted record has id 100
Last inserted record has id 125
Last inserted record has id 121
Last inserted record has id 126
Last inserted record has id 250
, 121, (126) id (.. 125 ), 122