douyou8266 2017-03-07 12:51
浏览 44
已采纳

从php调用mysql存储过程时出错

I have triggered the stored procedure from php. I have passed the input parameters also as shown.

$id = 1;
$nameDetail = 'raj';
$result = mysqli_query('CALL InsertDetails($id,$nameDetail)');

But getting below error.

mysqli_query() expects at least 2 parameters, 1 given ...

Please suggest a solution.

  • 写回答

2条回答 默认 最新

  • dongqing4070 2017-03-07 12:58
    关注

    The issue is that you're not set the mysqli connection.please try this

    $connection = mysqli_connect('localhost','username','password','db');
        $result = mysqli_query($connection,'CALL InsertDetails($id,$nameDetail)');
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?