Jump to content

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

 

Adrian

Link to comment
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

<?php
$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);
?>

Understand?

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.