我创建了一个存储过程,但在调用它时出现错误。
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 ''results0.79123800+1345985910.html')' at line 1
这是我在 php 代码中调用它的方式:
mysql_query("CALL lastscan($task_id,'$file_name')") or die(mysql_error());
我的数据库中有 sp..
如果它是引用的东西,我如何在不修改存储过程的情况下转义我放入其中的变量?
最佳答案
您的语法不正确,请使用:
mysql_query("CALL lastscan('" .$task_id. "', '" .$file_name. "')") or die(mysql_error());
关于php - mysql调用存储过程报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12130410/