TypeError thrown

Argument 1 passed to mysqli_num_fields() must be an instance of mysqli_result, bool given