很奇怪,PHP里不能一次执行两条查询语句吗?
$sqlstr = "INSERT INTO pw_threads ( fid, titlefont, author, subject, toolinfo, ifcheck, postdate, lastpost, lastposter )
VALUES ( $fid, '', '$user', '$title', '', 1, $post_time, $post_time, '$user' ); ";
$sqlstr .= " INSERT INTO pw_tmsgs ( tid, aid, userip, buy, ipfrom, alterinfo, content, form, ifmark, c_from )
VALUES ( @@identity, '', '127.0.0.1', '', '本地网络', '', '$content', '', '', '' ); \n";
像这样的包含两个insert语句的查询,运行居然会出错,显示
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; INSERT INTO pw_tmsgs ( tid, aid, userip, buy, ipfrom, alterinfo, content, for' at line 2111
但是把查询语句粘贴到EMS MySql Manager里(或者Mysql Front )里执行都没问题,把两个Insert语句分开执行也没有问题,但是在一次查询里执行竟然不行??
好奇怪啊