I have inherited a web site that runs on php / mysql and I am having trouble getting some of it to work. This is part of the script: function make_country_subcats($country,$pcountry,$accommsTable,$superbreakTable,$adsTable,$link,$category,$accommtype,$extra){ if($accommtype=="A"){ $acctype=""; }else{ $acctype=$accommtype; } $qry = "CREATE TEMPORARY TABLE tmp ("; $qry .= "county varchar(60) NOT NULL default '',"; $qry .= "categories varchar(60) NOT NULL default ''"; $qry .= ")"; if(!($results = mysql_query($qry, $link))){ displayErrMsg(sprintf("Error in executing %s query", $qry)); displayErrMsg(sprintf("error:%d %s", mysql_errno($link), mysql_error($link))); exit(); } $qry="INSERT INTO tmp (county) SELECT county FROM $accommsTable WHERE country = '$country' AND categories LIKE '%$acctype%'"; if(!($results = mysql_query($qry, $link))){ displayErrMsg(sprintf("Error in executing %s query", $qry)); displayErrMsg(sprintf("error:%d %s", mysql_errno($link), mysql_error($link))); $qry = "DROP TABLE tmp"; $results = mysql_query($qry, $link); exit(); } PHP: This is what I get when I run the web page: If anybody wants to look at the web site it is: http://www.holidays.org.uk/ You will then need to click on Directory and then select a category. e.g All Accommodation the England. Any help would be very welcome. Thanks John C