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 'AND field_keyword = 'page_theme'' 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 = 'page_theme'
array(5) {
  [0]=>
  array(4) {
    ["file"]=>
    string(70) "/data/vhosts/resilientbeings.co.uk/httpdocs/admin/pages/class.page.php"
    ["line"]=>
    int(309)
    ["function"]=>
    string(7) "dbQuery"
    ["args"]=>
    array(1) {
      [0]=>
      string(165) "SELECT val_value
				  FROM cms_page_fields, cms_page_field_values
				  	WHERE val_fieldID = field_id
				  AND val_pageID = 
				  AND field_keyword = 'page_theme'"
    }
  }
  [1]=>
  array(7) {
    ["file"]=>
    string(74) "/data/vhosts/resilientbeings.co.uk/httpdocs/site/includes/page_default.php"
    ["line"]=>
    int(19)
    ["function"]=>
    string(20) "get_custom_field_val"
    ["class"]=>
    string(4) "page"
    ["object"]=>
    object(page)#13 (32) {
      ["id"]=>
      string(0) ""
      ["parent"]=>
      string(1) "0"
      ["menu"]=>
      string(4) "none"
      ["dateModified"]=>
      string(10) "2023-10-12"
      ["title"]=>
      string(10) "What next?"
      ["menuTitle"]=>
      string(10) "What next?"
      ["slug"]=>
      string(9) "what-next"
      ["seo_req"]=>
      string(1) "1"
      ["pos"]=>
      string(1) "0"
      ["parentAsPage"]=>
      string(1) "1"
      ["active"]=>
      string(1) "0"
      ["showTitle"]=>
      string(1) "1"
      ["status"]=>
      string(5) "draft"
      ["accesskey"]=>
      string(0) ""
      ["maximages"]=>
      string(1) "0"
      ["uselinks"]=>
      string(1) "0"
      ["header"]=>
      string(1) "0"
      ["type"]=>
      string(1) "1"
      ["type_val"]=>
      string(0) ""
      ["language"]=>
      string(1) "1"
      ["user_access"]=>
      string(0) ""
      ["menuimg"]=>
      string(1) "0"
      ["menu_class"]=>
      string(0) ""
      ["ishome"]=>
      string(1) "0"
      ["path"]=>
      NULL
      ["text"]=>
      NULL
      ["fields"]=>
      array(6) {
        [0]=>
        array(12) {
          ["field_id"]=>
          string(1) "6"
          ["field_pageID"]=>
          string(1) "0"
          ["field_keyword"]=>
          string(10) "page_theme"
          ["field_type"]=>
          string(6) "SELECT"
          ["field_params"]=>
          string(64) "Default,default|
Mind,mind|
Movement,movement|
Mountain,mountain"
          ["field_label"]=>
          string(10) "Page theme"
          ["field_tips"]=>
          NULL
          ["field_pos"]=>
          string(1) "0"
          ["val_id"]=>
          string(4) "1874"
          ["val_pageID"]=>
          string(1) "5"
          ["val_fieldID"]=>
          string(1) "6"
          ["val_value"]=>
          string(7) "default"
        }
        [1]=>
        array(12) {
          ["field_id"]=>
          string(1) "1"
          ["field_pageID"]=>
          string(1) "0"
          ["field_keyword"]=>
          string(9) "pkg_price"
          ["field_type"]=>
          string(4) "TEXT"
          ["field_params"]=>
          string(0) ""
          ["field_label"]=>
          string(13) "Package price"
          ["field_tips"]=>
          string(0) ""
          ["field_pos"]=>
          string(1) "1"
          ["val_id"]=>
          NULL
          ["val_pageID"]=>
          NULL
          ["val_fieldID"]=>
          NULL
          ["val_value"]=>
          NULL
        }
        [2]=>
        array(12) {
          ["field_id"]=>
          string(1) "2"
          ["field_pageID"]=>
          string(1) "0"
          ["field_keyword"]=>
          string(12) "pkg_subtitle"
          ["field_type"]=>
          string(4) "TEXT"
          ["field_params"]=>
          NULL
          ["field_label"]=>
          string(16) "Package subtitle"
          ["field_tips"]=>
          NULL
          ["field_pos"]=>
          string(1) "1"
          ["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(14) "pkg_background"
          ["field_type"]=>
          string(5) "IMAGE"
          ["field_params"]=>
          NULL
          ["field_label"]=>
          string(24) "Package background image"
          ["field_tips"]=>
          NULL
          ["field_pos"]=>
          string(1) "2"
          ["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(11) "pkg_summary"
          ["field_type"]=>
          string(9) "TEXTBLOCK"
          ["field_params"]=>
          NULL
          ["field_label"]=>
          string(15) "Package summary"
          ["field_tips"]=>
          NULL
          ["field_pos"]=>
          string(1) "2"
          ["val_id"]=>
          NULL
          ["val_pageID"]=>
          NULL
          ["val_fieldID"]=>
          NULL
          ["val_value"]=>
          NULL
        }
        [5]=>
        array(12) {
          ["field_id"]=>
          string(1) "3"
          ["field_pageID"]=>
          string(1) "0"
          ["field_keyword"]=>
          string(12) "head_scripts"
          ["field_type"]=>
          string(9) "TEXTBLOCK"
          ["field_params"]=>
          NULL
          ["field_label"]=>
          string(12) "Head scripts"
          ["field_tips"]=>
          NULL
          ["field_pos"]=>
          string(1) "3"
          ["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(10) "page_theme"
    }
  }
  [2]=>
  array(4) {
    ["file"]=>
    string(74) "/data/vhosts/resilientbeings.co.uk/httpdocs/site/includes/content-page.php"
    ["line"]=>
    int(23)
    ["args"]=>
    array(1) {
      [0]=>
      string(74) "/data/vhosts/resilientbeings.co.uk/httpdocs/site/includes/page_default.php"
    }
    ["function"]=>
    string(7) "include"
  }
  [3]=>
  array(4) {
    ["file"]=>
    string(58) "/data/vhosts/resilientbeings.co.uk/httpdocs/site/index.php"
    ["line"]=>
    int(163)
    ["args"]=>
    array(1) {
      [0]=>
      string(74) "/data/vhosts/resilientbeings.co.uk/httpdocs/site/includes/content-page.php"
    }
    ["function"]=>
    string(7) "include"
  }
  [4]=>
  array(4) {
    ["file"]=>
    string(53) "/data/vhosts/resilientbeings.co.uk/httpdocs/index.php"
    ["line"]=>
    int(2)
    ["args"]=>
    array(1) {
      [0]=>
      string(58) "/data/vhosts/resilientbeings.co.uk/httpdocs/site/index.php"
    }
    ["function"]=>
    string(12) "include_once"
  }
}