下面是我尝试过的代码,但我似乎无法做出正确的调整来让脚本正常运行。使用PHP与LAST_INSERT_ID插入多个表格
$sql = 'INSERT INTO clients (first_name, last_name, email) VALUES('.$_POST['first_name'].', '.$_POST['last_name'].', '.$_POST['email'].')
INSERT INTO client_data (client_id, phone, zip, note) VALUES(LAST_INSERT_ID(), '.$_POST['phone'].', '.$_POST['zip'].', '.$_POST['message'].')';
mysql_query($sql) or die (mysql_error());
任何帮助,非常感谢。
附注:“Jimmy O'Brian”发出命令时会发生什么? – 2012-04-10 15:06:53
或者小鲍比桌子? (http://xkcd.com/327/) – 2012-04-10 15:08:05
@ÁlvaroG.Vicario黑客赢了,这就是发生了什么事。记得清理你的输入! – Matthematics 2012-04-10 15:08:50