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 = 'head_scripts'' 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 = 'head_scripts'
array(3) {
  [0]=>
  array(4) {
    ["file"]=>
    string(63) "/data/vhosts/fitnique.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 = 'head_scripts'"
    }
  }
  [1]=>
  array(7) {
    ["file"]=>
    string(54) "/data/vhosts/fitnique.co.uk/httpdocs/includes/meta.php"
    ["line"]=>
    int(207)
    ["function"]=>
    string(20) "get_custom_field_val"
    ["class"]=>
    string(4) "page"
    ["object"]=>
    object(page)#15 (32) {
      ["id"]=>
      NULL
      ["parent"]=>
      NULL
      ["menu"]=>
      NULL
      ["dateModified"]=>
      NULL
      ["title"]=>
      string(15) "Aches and Pains"
      ["menuTitle"]=>
      NULL
      ["slug"]=>
      NULL
      ["seo_req"]=>
      NULL
      ["pos"]=>
      NULL
      ["parentAsPage"]=>
      NULL
      ["active"]=>
      NULL
      ["showTitle"]=>
      NULL
      ["status"]=>
      NULL
      ["accesskey"]=>
      NULL
      ["maximages"]=>
      NULL
      ["uselinks"]=>
      NULL
      ["header"]=>
      NULL
      ["type"]=>
      NULL
      ["type_val"]=>
      NULL
      ["language"]=>
      NULL
      ["user_access"]=>
      NULL
      ["menuimg"]=>
      NULL
      ["menu_class"]=>
      NULL
      ["ishome"]=>
      NULL
      ["path"]=>
      NULL
      ["text"]=>
      NULL
      ["fields"]=>
      NULL
      ["links"]=>
      NULL
      ["images"]=>
      NULL
      ["leaf"]=>
      NULL
      ["trans_id"]=>
      NULL
      ["lang"]=>
      NULL
    }
    ["type"]=>
    string(2) "->"
    ["args"]=>
    array(1) {
      [0]=>
      string(12) "head_scripts"
    }
  }
  [2]=>
  array(4) {
    ["file"]=>
    string(46) "/data/vhosts/fitnique.co.uk/httpdocs/index.php"
    ["line"]=>
    int(150)
    ["args"]=>
    array(1) {
      [0]=>
      string(54) "/data/vhosts/fitnique.co.uk/httpdocs/includes/meta.php"
    }
    ["function"]=>
    string(7) "include"
  }
}