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

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

 

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

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

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

 

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

Leave a Comment