Hi I have my existing code
<?php
$query = sprintf("select venue,count(venue) as frequency from matches group by venue ORDER BY `frequency` DESC limit 300");
$result = mysql_query($query);
?>
and it outputs a table
<?php
$result = mysql_query($query);
while ($row = mysql_fetch_assoc($result))
{
$text = "".$row['venue'] . "";
$url = urlencode($text);
echo '<tr><td><a href="./venuedetails.php?v='. $url .'" target="_blank">'. $text .'</url></td>';
echo "<td> ".$row['frequency'] . "</td></tr>";
}
?>
I want to make it so that only venues where England have visited are counted for example. I have tried
$query = sprintf("select venue,count(venue) as frequency from matches WHERE Away = `England` group by venue ORDER BY `frequency` DESC limit 300");
but it doesn't work and I don't know what's wrong, apart from it telling me England doesn't exist when it does:'( :confused:
Any help would be great as I have searched and can only find the same way as I am using (and have used on other pages successfully (although not involving tables like this))
Thanks
Zack:)