0
mysql_query("INSERT INTO users(email, password) VALUES ('$email','$password')");
$user_id = mysql_insert_id();
mysql_query("INSERT INTO business_details (business_id, name, address, city, state, country, pincode) VALUES ('$category','$business_name', '$business_address', '$city', '$state', '$country', '$pincode')");
$idB = mysql_insert_id();
mysql_query("INSERT INTO user_profiles (name, phone, user_id, business_details_id) VALUES ('$person_name', '$phone_number', '$user_id', '$idB')");
将所有查询插入到一个查询中的最佳方法是什么?可能吗?多个INSERT查询提取每个查询的每个last_insert_id
的可能重复的[SQL - 插入多个表中一个查询](http://stackoverflow.com/questions/3860280/sql-插入到多表一体式查询) –
如果您想要最后一个ID,然后单独运行查询。 –
如何从您的ref中获取每个的last_insert_id? –