Jump to content


This topic is now archived and is closed to further replies.


Select records based on valued passed from url

Recommended Posts

Hi I'm relatively new at all this so bear with me.


I have a page with a Map of Ireland and all the Counties on it. I've created hotspots for each county and what I need to do is that when someone clicks on a county it opens up a separate page and only lists the clubs in that county.


i.e. If someone clicks on Dublin, that the next page will list only all the clubs in Dublin and nothing else.


Thanks in Advance



Share this post

Link to post
Share on other sites

well assuming u want to do it where u use only two pages lets say like

country.php and view.php u will need to store each club in a database and make a row where it says country then when u make a link on each place in Ireland like www.domainname.com/view.php?country=dublin then to pull up all the clubs u will need to do something like

$colname_clubs = "-1";
if (isset($_GET['country'])) {
  $colname_clubs = (get_magic_quotes_gpc()) ? $_GET['country'] : addslashes($_GET['country']);
$query_clubs = sprintf("SELECT clubname FROM clubs WHERE country = '%s'", $colname_clubs);
$clubs = mysql_query($query_clubs, $gameVOICE) or die(mysql_error());
$row_clubs = mysql_fetch_assoc($clubs);
$totalRows_clubs = mysql_num_rows($clubs);



Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.