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.