My Unknown error type: [2] on line 531: mysqli_connect(): (HY000/2002): Connection refused

My Unknown error type: [2] on line 531: mysqli_error() expects exactly 1 parameter, 0 given

FATAL ERROR [256] on line 531 in file /var/www/html/ELCofSWFL.register/registration/resources/resources.php, PHP version 7.4.16 (running on Linux)
Database connection failed for elcofswfl because !
Aborting...