PHP 8 Uncaught TypeError: mysqli_num_rows(): Argument #1 ($result) must be of type mysqli_result [duplicate]

After I moved my website from windows server and ubuntu and from php 7.3 to php 8 I get countless annoying fatal errors

I need to fix this VERY quickly

All of this isn’t helping:

PHP message: PHP Fatal error: Uncaught TypeError: mysqli_fetch_assoc(): Argument #1 ($result) must be of type mysqli_result, bool given

How to deal with mysqli problems? mysqli_fetch_array(): Argument #1 must be of type mysqli_result

this is the code:

    $queryReceiver = 
    mysqli_query($con, "SELECT userid,nickname,token FROM members JOIN android_notif ON members.userid = android_notif.last_online_id WHERE members.userid IN ($final) AND android_notif.blocked_userids NOT LIKE '%,$userid,%'");

        if(mysqli_num_rows($queryReceiver) > 0){

I get:

PHP message: PHP Fatal error:  Uncaught TypeError: mysqli_num_rows(): Argument #1 ($result) must be of type mysqli_result, bool given in /var/www/vhosts/yolol.de/httpdocs/do_post_comment.php:352nStack trace:n#0 /var/www/vhosts/yolol.de/httpdocs/do_post_comment.php

How to fix this afap without changing db or whatever?? Please help