获取mysql中刚刚insert的数据的id的
$sql = "INSERT INTO person VALUES ('Carter','Thomas','Beijing')";
$result = mysql_query($sql); //执行插入
echo mysql_insert_id(); //获取上一步插入的ID
$sql = "INSERT INTO person VALUES ('Carter','Thomas','Beijing')";
$result = mysql_query($sql); //执行插入
echo mysql_insert_id(); //获取上一步插入的ID