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.
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)');
You need to pass in the connection as the first parameter:
// connect to DB
$connect = mysqli_connect("127.0.0.1", "my_user", "my_password", "my_db");
// run procedure
$result = mysqli_query($connect, 'CALL InsertDetails($id,$nameDetail)');