\r\n"; mail('jim.rolt@googlemail.com', $subject, $error, $headers); } include'dataedit/sql.php'; //include'memcache.php'; $sql = "SELECT SQL_CACHE AreasMain.RecordID, AreaName, CountyName FROM AreasMain INNER JOIN CountyDetails ON CountyDetails.RecordID = AreasMain.CountyID ORDER BY DateEntered DESC LIMIT 1"; $dest = mysql_query($sql)or mailjim("re", "$sql\n".mysql_error()); $latest = mysql_fetch_object($dest); $sq = "SELECT filmid, title, votes FROM films ORDER BY votes DESC LIMIT 3"; $fv = mysql_query($sq); $sq = "SELECT Shopvotes.*, Name FROM Shopvotes INNER JOIN Shops ON Shops.ID = Shopvotes.placeID ORDER BY votes DESC LIMIT 3"; $sv = mysql_query($sq); $sq = "SELECT Eventvotes.*, event FROM Eventvotes INNER JOIN events ON events.eventid = Eventvotes.placeID ORDER BY votes DESC LIMIT 3"; $ev = mysql_query($sq); $sq = "SELECT Britvotes.*, name FROM Britvotes INNER JOIN famous ON Britvotes.placeID = famous.id ORDER BY votes DESC LIMIT 3"; $fbv = mysql_query($sq); $sql = "SELECT EstDetails.RecordID, EstDetails.Name, Town, EstDetails.County, votes, Towns.ID, AttractionType.Name AS AName, EstablishmentType.TYPE FROM EstDetails INNER JOIN Estvotes ON Estvotes.placeID = EstDetails.RecordID INNER JOIN EstablishmentType ON EstablishmentType.ID = EstDetails.EstType LEFT JOIN Towns ON Towns.Name = EstDetails.Town AND Towns.County = EstDetails.County LEFT JOIN AttractionType ON AttractionType.ID = EstDetails.AttractionType AND AttractionType.ID NOT IN(5,6,7,9,10,11,13) WHERE EstType IN(1,2,3,5,9,12,14,15,16,23,24,27,28,31,37,43) ORDER BY votes DESC"; $atv = mysql_query($sql); //$atv = mysql_query_cache($sql); $sql = "SELECT DISTINCT Name, County, votes, CountyName FROM Towns INNER JOIN townvotes ON townvotes.townid = Towns.ID INNER JOIN CountyDetails ON CountyDetails.RecordID = Towns.County ORDER BY votes DESC LIMIT 3"; $tov = mysql_query($sql)or mailjim("tov","$sql
".mysql_error()); $resultarry = array(); $linkarray = array(); while($film = mysql_fetch_object($fv)){ $resultarry['Film'][] = "$film->title"; $linkarray ['Film']= 'bestfilm.php'; } while($town = mysql_fetch_object($tov)){ $resultarry['Town'][] = "$town->Name"; $linkarray ['Town']= 'favouritetowns.php'; } while($shop = mysql_fetch_object($sv)){ $resultarry['Shop'][] = "$shop->Name"; $linkarray ['Shop']= 'favouriteshops.php'; } while($event = mysql_fetch_object($ev)){ $resultarry['Event'][] = "$event->event"; $linkarray ['Event']= 'favouritevents.php'; } while($brit = mysql_fetch_object($fbv)){ $resultarry['Famous Briton'][] = "$brit->name"; $linkarray ['Famous Briton']= 'favouritebrits.php'; $picarray[] = $brit->placeID; } while($est = mysql_fetch_object($atv)){ //foreach($atv as $est){ $typename = isset($est->AName) ? $est->AName : $est->TYPE; switch($typename){ case 'Inn': $typename = 'Pub and Bar'; break; case 'Farmers Market': $typename = 'Market'; break; case 'Accommodation': $typename = 'Hotel'; break; } $arraycount = isset($resultarry[$typename]) ? count($resultarry[$typename]) : 0; if($arraycount <=2){ $townbit = $est->ID ? "$est->Town" : $est->Town; $resultarry[$typename][] = "$est->Name, $townbit"; } $linkarray[$typename] = $est->TYPE == 'Attraction' && isset($est->AName) ? 'favouriteplaces/type/Attraction/'.rawurlencode($typename).'/' : 'favouriteplaces/type/'.rawurlencode($typename).'/'; } mysql_data_seek($atv, 0); $arraycount = 0; while($est = mysql_fetch_object($atv)){ //foreach($atv as $est){ if($est->TYPE == 'Attraction'){ $townbit = $est->ID ? "$est->Town" : $est->Town; $resultarry['Attraction'][$arraycount] = "$est->Name, $townbit"; $arraycount ++; } if($arraycount == 3){break;} } ksort($resultarry); $sql = "SELECT (SELECT SUM(votes) FROM films) + (SELECT SUM(votes) FROM Shopvotes) + (SELECT SUM(votes) FROM Eventvotes) + (SELECT SUM(votes) FROM Britvotes) + (SELECT SUM(votes) FROM townvotes) + (SELECT SUM(votes) FROM Estvotes) AS total"; $tot = mysql_query($sql)or mailjim("tot", "$sql
".mysql_error()); $total = mysql_fetch_object($tot); $pageurl = $_SERVER['REQUEST_URI']; $cpcount = mysql_query("UPDATE pagecounter SET pagecount=pagecount+1 WHERE pageurl = '$pageurl'"); if(mysql_affected_rows()==0){$cpcount = mysql_query("INSERT INTO pagecounter(pageurl, pagecount, firstday) VALUES ('$pageurl', 1, NOW())");} $cq = mysql_query("SELECT pagecount FROM pagecounter WHERE pageurl = '$pageurl' "); $gcq = mysql_fetch_object($cq); $vcount = $gcq->pagecount; ?> Favourite Britain
\n"; break; } } include'lrform.php'; include'connect.php'; connect('', '', "Favourite Britain", $vcount, '2nd June 2010'); ?>
Favourite Britain, $total->total votes since 20/02/2010"; include'linkunit.txt'; ?>

This may be a United Kingdom, but ask any two of us to nominate their favourite Briton and you will probably get three suggestions - two names and one physical impossibility when you disagree vehemently with both. Repeat the process with favourite film, restaurant, town, theatre, attraction and a host of others and you'll elicit the same response - everyone has their own opinion which is coincidentally the correct one. And of course it is: there is no right answer to questions of taste and preference - except yours. Thank goodness we don't all think alike - that reflects the riches, individuality, and sometimes the unashamed strangeness of this country. Information Britain loves the breadth of responses received so far, and anticipates further surprises as the voting continues.

{$_POST['townbox']} has $tvote->votes votes

\n

";} elseif(isset($place)){echo"Your vote for $tn->Name has been recorded, thank you!
$tn->Name has $tn->votes votes

\n

";} elseif(!empty($_GET['name'])){echo"Your vote for {$_GET['name']} has been recorded, thank you!

\n

";} foreach($resultarry as $key => $v){ if(isset($count)){echo' | ';} echo"$key"; $count = 1; } echo'

'; foreach($resultarry as $key => $value){ $count = 1; echo"

$key"; foreach($value as $link){ echo"
$count: $link\n"; $count ++; } echo"...More

"; } echo"

Britains Best Breaks

"; include'dailyfeature.php'; ?>