You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND field_keyword = 'hide_sidebar'' at line 5
SELECT val_value FROM cms_page_fields, cms_page_field_values WHERE val_fieldID = field_id AND val_pageID = AND field_keyword = 'hide_sidebar'
array(5) {
  [0]=>
  array(4) {
    ["file"]=>
    string(71) "/data/vhosts/alienhydroponics.co.uk/httpdocs/admin/pages/class.page.php"
    ["line"]=>
    int(309)
    ["function"]=>
    string(7) "dbQuery"
    ["args"]=>
    array(1) {
      [0]=>
      string(167) "SELECT val_value
				  FROM cms_page_fields, cms_page_field_values
				  	WHERE val_fieldID = field_id
				  AND val_pageID = 
				  AND field_keyword = 'hide_sidebar'"
    }
  }
  [1]=>
  array(7) {
    ["file"]=>
    string(75) "/data/vhosts/alienhydroponics.co.uk/httpdocs/site/includes/page-default.php"
    ["line"]=>
    int(7)
    ["function"]=>
    string(20) "get_custom_field_val"
    ["class"]=>
    string(4) "page"
    ["object"]=>
    object(page)#20 (32) {
      ["id"]=>
      string(0) ""
      ["parent"]=>
      string(2) "28"
      ["menu"]=>
      string(7) "mainNav"
      ["dateModified"]=>
      string(10) "2021-07-15"
      ["title"]=>
      string(26) "Frequently Asked Questions"
      ["menuTitle"]=>
      string(26) "Frequently Asked Questions"
      ["slug"]=>
      string(26) "frequently-asked-questions"
      ["seo_req"]=>
      string(1) "1"
      ["pos"]=>
      string(2) "15"
      ["parentAsPage"]=>
      string(1) "1"
      ["active"]=>
      string(1) "0"
      ["showTitle"]=>
      string(1) "1"
      ["status"]=>
      string(5) "draft"
      ["accesskey"]=>
      string(0) ""
      ["maximages"]=>
      string(1) "1"
      ["uselinks"]=>
      string(1) "0"
      ["header"]=>
      string(1) "1"
      ["type"]=>
      string(1) "1"
      ["type_val"]=>
      string(0) ""
      ["language"]=>
      string(1) "1"
      ["user_access"]=>
      string(0) ""
      ["menuimg"]=>
      string(1) "0"
      ["menu_class"]=>
      NULL
      ["ishome"]=>
      string(1) "0"
      ["path"]=>
      NULL
      ["text"]=>
      NULL
      ["fields"]=>
      array(8) {
        [0]=>
        array(12) {
          ["field_id"]=>
          string(1) "1"
          ["field_pageID"]=>
          string(1) "0"
          ["field_keyword"]=>
          string(12) "hide_sidebar"
          ["field_type"]=>
          string(8) "CHECKBOX"
          ["field_params"]=>
          NULL
          ["field_label"]=>
          string(16) "Hide the sidebar"
          ["field_tips"]=>
          NULL
          ["field_pos"]=>
          string(1) "0"
          ["val_id"]=>
          NULL
          ["val_pageID"]=>
          NULL
          ["val_fieldID"]=>
          NULL
          ["val_value"]=>
          NULL
        }
        [1]=>
        array(12) {
          ["field_id"]=>
          string(1) "2"
          ["field_pageID"]=>
          string(1) "0"
          ["field_keyword"]=>
          string(12) "sidebar_link"
          ["field_type"]=>
          string(4) "TEXT"
          ["field_params"]=>
          NULL
          ["field_label"]=>
          string(12) "Sidebar link"
          ["field_tips"]=>
          NULL
          ["field_pos"]=>
          string(1) "1"
          ["val_id"]=>
          NULL
          ["val_pageID"]=>
          NULL
          ["val_fieldID"]=>
          NULL
          ["val_value"]=>
          NULL
        }
        [2]=>
        array(12) {
          ["field_id"]=>
          string(1) "3"
          ["field_pageID"]=>
          string(1) "0"
          ["field_keyword"]=>
          string(18) "sidebar_link_label"
          ["field_type"]=>
          string(4) "TEXT"
          ["field_params"]=>
          NULL
          ["field_label"]=>
          string(12) "Sidebar link"
          ["field_tips"]=>
          NULL
          ["field_pos"]=>
          string(1) "2"
          ["val_id"]=>
          NULL
          ["val_pageID"]=>
          NULL
          ["val_fieldID"]=>
          NULL
          ["val_value"]=>
          NULL
        }
        [3]=>
        array(12) {
          ["field_id"]=>
          string(1) "4"
          ["field_pageID"]=>
          string(1) "0"
          ["field_keyword"]=>
          string(12) "banner_title"
          ["field_type"]=>
          string(9) "TEXTBLOCK"
          ["field_params"]=>
          string(0) ""
          ["field_label"]=>
          string(12) "Banner title"
          ["field_tips"]=>
          string(0) ""
          ["field_pos"]=>
          string(2) "10"
          ["val_id"]=>
          NULL
          ["val_pageID"]=>
          NULL
          ["val_fieldID"]=>
          NULL
          ["val_value"]=>
          NULL
        }
        [4]=>
        array(12) {
          ["field_id"]=>
          string(1) "5"
          ["field_pageID"]=>
          string(1) "0"
          ["field_keyword"]=>
          string(15) "banner_subtitle"
          ["field_type"]=>
          string(9) "TEXTBLOCK"
          ["field_params"]=>
          string(0) ""
          ["field_label"]=>
          string(15) "Banner subtitle"
          ["field_tips"]=>
          string(0) ""
          ["field_pos"]=>
          string(2) "20"
          ["val_id"]=>
          NULL
          ["val_pageID"]=>
          NULL
          ["val_fieldID"]=>
          NULL
          ["val_value"]=>
          NULL
        }
        [5]=>
        array(12) {
          ["field_id"]=>
          string(1) "6"
          ["field_pageID"]=>
          string(1) "0"
          ["field_keyword"]=>
          string(11) "banner_text"
          ["field_type"]=>
          string(9) "TEXTBLOCK"
          ["field_params"]=>
          string(0) ""
          ["field_label"]=>
          string(11) "Banner text"
          ["field_tips"]=>
          string(0) ""
          ["field_pos"]=>
          string(2) "30"
          ["val_id"]=>
          NULL
          ["val_pageID"]=>
          NULL
          ["val_fieldID"]=>
          NULL
          ["val_value"]=>
          NULL
        }
        [6]=>
        array(12) {
          ["field_id"]=>
          string(1) "7"
          ["field_pageID"]=>
          string(1) "0"
          ["field_keyword"]=>
          string(14) "banner_btn_txt"
          ["field_type"]=>
          string(4) "TEXT"
          ["field_params"]=>
          string(0) ""
          ["field_label"]=>
          string(18) "Banner button text"
          ["field_tips"]=>
          string(0) ""
          ["field_pos"]=>
          string(2) "40"
          ["val_id"]=>
          NULL
          ["val_pageID"]=>
          NULL
          ["val_fieldID"]=>
          NULL
          ["val_value"]=>
          NULL
        }
        [7]=>
        array(12) {
          ["field_id"]=>
          string(1) "8"
          ["field_pageID"]=>
          string(1) "0"
          ["field_keyword"]=>
          string(14) "banner_btn_url"
          ["field_type"]=>
          string(4) "TEXT"
          ["field_params"]=>
          string(0) ""
          ["field_label"]=>
          string(18) "Banner button link"
          ["field_tips"]=>
          string(0) ""
          ["field_pos"]=>
          string(2) "50"
          ["val_id"]=>
          NULL
          ["val_pageID"]=>
          NULL
          ["val_fieldID"]=>
          NULL
          ["val_value"]=>
          NULL
        }
      }
      ["links"]=>
      array(0) {
      }
      ["images"]=>
      array(0) {
      }
      ["leaf"]=>
      bool(true)
      ["trans_id"]=>
      NULL
      ["lang"]=>
      string(2) "en"
    }
    ["type"]=>
    string(2) "->"
    ["args"]=>
    array(1) {
      [0]=>
      string(12) "hide_sidebar"
    }
  }
  [2]=>
  array(4) {
    ["file"]=>
    string(75) "/data/vhosts/alienhydroponics.co.uk/httpdocs/site/includes/content-page.php"
    ["line"]=>
    int(31)
    ["args"]=>
    array(1) {
      [0]=>
      string(75) "/data/vhosts/alienhydroponics.co.uk/httpdocs/site/includes/page-default.php"
    }
    ["function"]=>
    string(7) "include"
  }
  [3]=>
  array(4) {
    ["file"]=>
    string(59) "/data/vhosts/alienhydroponics.co.uk/httpdocs/site/index.php"
    ["line"]=>
    int(227)
    ["args"]=>
    array(1) {
      [0]=>
      string(75) "/data/vhosts/alienhydroponics.co.uk/httpdocs/site/includes/content-page.php"
    }
    ["function"]=>
    string(7) "include"
  }
  [4]=>
  array(4) {
    ["file"]=>
    string(54) "/data/vhosts/alienhydroponics.co.uk/httpdocs/index.php"
    ["line"]=>
    int(2)
    ["args"]=>
    array(1) {
      [0]=>
      string(59) "/data/vhosts/alienhydroponics.co.uk/httpdocs/site/index.php"
    }
    ["function"]=>
    string(12) "include_once"
  }
}