TypeError thrown

mysqli_num_fields(): Argument #1 ($result) must be of type mysqli_result, bool given