我的代码中有一些查询
...
echo $query;
mysql_query($query)
or die(mysql_error());
Run Code Online (Sandbox Code Playgroud)
当我运行它时,输出以下内容:
INSERT INTO test ( c1, c2, c3, c4, c5)
VALUES ('xo', 'VxbcS','rzDMœSfsg', 'œsAcdiNwu','axaWMYOOj');
INSERT INTO test ( c1, c2, c3, c4, c5)
VALUES ('ihTnUcBU', 'plKtJdsRT','PyJUPBx', 'f','SspBuWJiK');
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 test ( c1, c2, c3, c4, c5) VALUES ('ihTnUcBU', 'plKtJdsRT',' at line 3
Run Code Online (Sandbox Code Playgroud)
如果我复制上面的插入查询并直接在phpmyadmin中运行它,它没有任何问题.但是当我运行php代码时它不起作用,是否有人知道这里看起来有什么问题?感谢帮助.
您可以一次只运行一个查询.
或使用多插入查询
INSERT INTO test ( c1, c2, c3, c4, c5)
VALUES
('xo', 'VxbcS','rzDMœSfsg', 'œsAcdiNwu','axaWMYOOj'),
('ihTnUcBU', 'plKtJdsRT','PyJUPBx', 'f','SspBuWJiK');
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
353 次 |
| 最近记录: |