Warning: mysqli_query() expects parameter 1 to be mysqli, string given in

It’s exactly as the error states as you’re passing arguments to mysqli_query() incorrectly. Assuming $conn is your mysqli connection generated at some point by new mysqli() it should be:

$result = mysqli_query( $conn,$sql) or trigger_error(mysqli_error($conn)));

The way you were calling it you were passing a string, $sql as the first argument.

Leave a Comment