Jump to content


Photo

Select records based on valued passed from url


  • Please log in to reply
1 reply to this topic

#1 Donaido

Donaido
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 21 November 2005 - 10:33 PM

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

#2 chriscloyd

chriscloyd
  • Members
  • PipPipPip
  • Advanced Member
  • 489 posts
  • LocationArizona

Posted 24 November 2005 - 01:35 AM

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?

44 bugs in my java code
44 bugs in my java code
Fix 1 bug, and complie again
122 bugs in my java code




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users