mysqli - fetch_Array error call to a member function fetch_array() on a non-object mysqli
This answer has been written very long time ago and become irrelevant.
Since then I learned the proper solution for this problem and wrote it in this answer. Please navigate there.
The query probably failed and mysqli::query
returned FALSE. Therefore $runGetChartData
is not a mysqli_result
object, but a boolean
, which is why you are getting your error.
From the documentation:
Returns FALSE on failure. For successful SELECT, SHOW, DESCRIBE or EXPLAIN queries mysqli_query() will return a mysqli_result object. For other successful queries mysqli_query() will return TRUE.