Fixed! – can't login to my site and SQL error!

I have a Drupal 6 site that hasn’t been changed for more than a year, suddenly I get the below message when visiting the site and when I try to login to the site it says: “You are not authorized to access this page.”

  • warning: array_keys() expects parameter 1 to be array, null given in /home/wwwhaya/public_html/modules/user/user.module on line 531.
  • user warning: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘)’ at line 1 query: SELECT p.perm FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in /home/wwwhaya/public_html/modules/user/user.module on line 531.
  • warning: array_keys() expects parameter 1 to be array, null given in /home/wwwhaya/public_html/modules/block/block.module on line 459.
  • warning: array_merge(): Argument #2 is not an array in /home/wwwhaya/public_html/modules/block/block.module on line 460.
  • user warning: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘) OR r.rid IS NULL) ORDER BY b.region, b.weight, b.module’ at line 1 query: SELECT DISTINCT b.* FROM blocks b LEFT JOIN blocks_roles r ON b.module = r.module AND b.delta = r.delta WHERE b.theme = ” AND b.status = 1 AND (r.rid IN () OR r.rid IS NULL) ORDER BY b.region, b.weight, b.module in /home/wwwhaya/public_html/modules/block/block.module on line 460.

Please help!

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/22/feed