mysqli_query() expects parameter 1 to be mysqli, object given

You want to pass in $connection->myconn instead of $connection. As in:

$result = mysqli_query($connection->myconn, $query);

As it stands, you’re passing in an instance of your class, rather than a mysqli, which is what the error messages are complaining about.

Leave a Comment