2010-08-13 96 views

回答

4

您可以使用此功能:mysql_insert_id() - 獲取在最後查詢生成的ID

mysql_query("INSERT INTO mytable (product) values ('kossu')"); 
printf("Last inserted record has id %d\n", mysql_insert_id()); 

更多信息here