Warning: mysqli_error() expects exactly 1 parameter, 0 given error

后端 未结 4 1609
夕颜
夕颜 2020-11-27 19:58

I get the following error

Warning: mysqli_error() expects exactly 1 parameter, 0 given

The problem is with this line of the c

4条回答
  •  萌比男神i
    2020-11-27 20:27

    mysqli_error() needs you to pass the connection to the database as a parameter. Documentation here has some helpful examples:

    http://php.net/manual/en/mysqli.error.php

    Try altering your problem line like so and you should be in good shape:

    $query = mysqli_query($myConnection, $sqlCommand) or die (mysqli_error($myConnection)); 
    

提交回复
热议问题