Php 使用多参数的MySQL存储过程

Php 使用多参数的MySQL存储过程,php,mysql,mysqli,Php,Mysql,Mysqli,我可以使用带有一个参数的MySQL存储过程,但是当我尝试使用多个参数时,存储过程不需要调用。我将粘贴php代码,然后粘贴SQL代码。有人能指出它为什么不起作用吗 谢谢 <?php //DB Connection include include '/connection/proccon.php'; $skill=1; $level=1; $user=1; //SQL for identify user $sqlquestion = sprintf("call upda

我可以使用带有一个参数的MySQL存储过程,但是当我尝试使用多个参数时,存储过程不需要调用。我将粘贴php代码,然后粘贴SQL代码。有人能指出它为什么不起作用吗

谢谢

<?php 

//DB Connection include
include '/connection/proccon.php';    

 $skill=1;
 $level=1;
 $user=1;

//SQL for identify user 
$sqlquestion = sprintf("call updatequestion('%s, %s, %s')", $skill, $user, $level);

echo $sqlquestion;
$resultquestion = mysqli_query($link, $sqlquestion);    

?>
将其更改为:

$sqlquestion = sprintf("call updatequestion(%s, %s, %s)", $skill, $user, $level);

引号将所有参数组合成一个字符串。

更好地使用引号,您将3个参数包含在2个引号中,我认为这是错误的

解决方案:

**

$sqlquestion=sprintf(“调用updatequestion(%s,%s,%s)”, $skill、$user、$level)

**


祝您度过愉快的一天

您在所有参数周围加了引号,因此它只是一个字符串,而不是3个单独的参数。谢谢您,花了很多时间在这方面,很少有在线使用此符号。这里有多个参数的过程示例:
$sqlquestion = sprintf("call updatequestion(%s, %s, %s)", $skill, $user, $level);