Ok I've moved all the $mysqli->query($query) statements out to a function and also have a variant that returns $result with the $result = $mysqli->query($query); also in the function.
I'm doing queries on databases that I know have results but I keep getting errors in my error log.
PHP Fatal error: Call to a member function fetch_object() on a non-object in ...
However, I cannot get the program to die or reproduce that error either on my local system or online when I access it. I can circumvent the error by enclosing all the code in an
if($result)
statement but that sort of eliminates all the stuff that is going to be displayed and I know that the results should be coming out of the database as I'm not asking for something that wouldn't be there.
Any ideas?