This is going to be tough to explain but I'll give it a shot. I have a database issue here... I have a database called "trips" that has a list of the trips we offer. I also have a database of "sub-trips" that can be extended to the customer whil they are in a particular country. The problem I'm having is that when the customer is on a particular trip page (like this one: http://journeys-intl.com/take_out/more_info3.php?trip_id=122) they should be able to view ALL the subtrips that are available. Currently I can only get the first number listed in the field to show up when they click the link Extensions/Dig Deepers. So I have this column in my database called extension_id that can contain several different extension id's, but I cannot get them to show up!!!! Please help me or give me suggestions. Here is how I currently have it setup.
more_info.php:
<head>
<title>Journeys Search Results</title>
<script src="http://journeys-intl.com/scripts/javascripts.js" type="text/javascript">
</script>
</head>
<body>
<?
include ("http://journeys-intl.com/includes/header.html");
$result=mysql_query("SELECT * FROM master_trips WHERE trip_id='$trip_id'");
//Output Table
//Give it style
if ($myrow = mysql_fetch_array($result))
{
do{
$extension_id=urlencode($myrow["extension_id"]);
$trip_id=urlencode($myrow["trip_id"]);
$country=urlencode($myrow["country"]);
$find="%$country%";
echo "<font face=Garamond color=#E88B00 size=6><b>";
echo $myrow['trp_name'];
echo "</font></b><br><br>";
echo "<a href=javascript:GradesPopUp('http://journeys-intl.com/travel_conditions.html')>";
echo "<img border=0 src=".$image_path."/".$myrow['climate_bar'].">";
echo "</a>";
echo "<br><br><table border='1' cellpadding='4' width='700' bordercolor='#BDB482' bgcolor=#EEEEEE>";
echo "<tr>";
echo "<td valign='top'><font face=Arial size=3><table border='0' cellspacing='0' width='680' cellpadding='2'>";
echo "<tr>";
echo "<td rowspan='7' valign='top' width='150'>";
echo "<table border='0' cellpadding='0' cellspacing='0'>";
echo "<tr>";
echo "<td>";
echo "<img src=".$image_path."/".$myrow['icon']." border=1>";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</td>";
echo "<td align='left' width='360'><font face=Arial size=3><strong><a href=javascript:GradesPopUp('http://journeys-intl.com/land_cost.html')>Cost:</a></strong> ";
echo $myrow['cost'];
echo "</td>";
echo "<td rowspan='7' valign='top' align='right' width='160'> <font face=Arial size=3>";
echo "<center>";
echo "<table border='1' cellpadding='2' width='150' cellspacing='0' bordercolor='#73AA46'>";
echo "<tr>";
echo "<td bgcolor=#73AA46> <font face=Arial size=3>";
echo "<p align='center'><font face=Arial size=3 color=#FFFFFF><strong>Useful Links</strong></td>";
echo "</tr>";
echo "<tr>";
echo "<td valign='top' align='left' bgcolor=#FFFFFF> <font face=Arial size=3>";
echo "<table border='0' cellpadding='2' cellspacing='0' width='150'>";
echo "<tr>";
echo "<td width='6'> <font face=Arial size=3><img border='0' src='http://www.journeys-intl.com/images/square.gif'></td>";
echo "<td width='130'> <font face=Arial size=3><strong><a href='search_reviews_static.php?country=$find'>Trip Reviews</a></strong></td>";
echo "</tr>";
echo "<tr>";
echo "<td width='6'> <font face=Arial size=3><img border='0' src='http://www.journeys-intl.com/images/square.gif'></td>";
echo "<td width='130'> <font face=Arial size=3><strong><a href='http://journeys-intl.com/galleries/galleries.html'>Photo Gallery</a></strong></td>";
echo "</tr>";
echo "<tr>";
echo "<td width='6'> <font face=Arial size=3><img border='0' src='http://www.journeys-intl.com/images/square.gif'></td>";
echo "<td width='130'> <font face=Arial size=3><strong><a href='search_extensions.php?extension_id=$extension_id'>Extensions/Dig Deepers</a></strong></td>";
echo "</tr>";
echo "<tr>";
echo "<td width='6'> <font face=Arial size=3><img border='0' src='http://www.journeys-intl.com/images/square.gif'></td>";
echo "<td width='130'> <font face=Arial size=3><strong><a href='http://www.journeys-intl.com/take_out/download.php' target='_blank'>Email this page</a></strong></td>";
echo "</tr>";
echo "<tr>";
echo "<td width='6'> <font face=Arial size=3><img border='0' src='http://www.journeys-intl.com/images/square.gif'></td>";
echo "<td width='130'> <font face=Arial size=3><strong><a href='http://journeys-intl.com/take_out/more_info_print.php?trip_id=$trip_id' target='_blank'>Printer Friendly</a></strong></td>";
echo "</tr>";
echo "</table>";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</center>";
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td width='70%'> <font face=Arial size=3><strong>Single Supplement:</strong> ";
echo $myrow['supplement'];
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td width='70%'> <font face=Arial size=3><strong>Number of Days: </strong>";
echo $myrow['duration'];
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td width='70%'> <font face=Arial size=3><strong><a href=javascript:GradesPopUp('http://journeys-intl.com/lodging.html')>Lodging:</a> </strong>";
echo $myrow['lodging'];
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td width='70%'> <font face=Arial size=3><strong><a href=javascript:GradesPopUp('http://journeys-intl.com/grades.html')>Grade:</a> </strong>";
echo $myrow['grade'];
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td width='70%'> <font face=Arial size=3><strong>Group Size: </strong>";
echo $myrow['group_size'];
echo "</td>";
echo "</tr>";
echo "<table border='0' cellpadding='0' cellspacing='0' width='100%'>";
echo "<tr>";
echo "<td width='100%'><font face=Arial size=3><strong><br>Dates<br></strong>";
echo $myrow['dates'];
echo "<br></td>";
echo "</tr>";
echo "</table><br><br>";
echo "<hr noshade size='1'>";
echo $myrow['description'];
echo "<hr noshade size='1'>";
echo $myrow['itinerary'];
echo "</tr>";
echo "</table><br><br>";
echo "<table border=0 width=700>";
echo "<tr><td align=center> <font face=Arial size=3>";
echo "<a href='javascript: history.go(-1)'><img src='http://journeys-intl.com/images/arrow.gif' border=0 alt=arrow.gif> Back</a> ";
echo " <a href='http://journeys-intl.com/take_out/more_info_print.php?trip_id=$trip_id' target='_blank'><img src='http://journeys-intl.com/images/printer.gif' border=0 alt=printer.gif> Printer friendly version</a>";
echo "</tr></td></table>";
}
while ($myrow=mysql_fetch_array($result));
}
else
{
echo "OOooooo too bad.<br>";
echo "No records were found.";
echo "<a href='javascript: history.go(-1)'>Back</a>";
}
include ("http://journeys-intl.com/includes/footer2.html");
?>
</body>
search_extensions.php:
<head>
<title>Journeys Search Results</title>
</head>
<body>
<?
include ("http://journeys-intl.com/includes/header.html");
//Perform query depending on user's selection
$result = mysql_query("SELECT * FROM extensions WHERE extension_id='$extension_id\n'");
//Output Table
//Give it style
if ($myrow = mysql_fetch_array($result))
{
$num_results=mysql_num_rows($result);
echo "<strong>Number of extensions found: </strong><big><strong><font color=#008000>$num_results</font></strong></big><br><br>";
echo "<strong><font size=2 face=arial><img src='http://journeys-intl.com/images/arrow.gif' border=0 alt=arrow.gif><a href='javascript: history.go(-1)'> Back</a></font></strong><br>";
do{
$extension_id=$myrow['extension_id'];
echo "<br><TABLE BGCOLOR=#003366 WIDTH=700 BORDER=1 CELLPADDING=4 CELLSPACING=1>";
echo "<tr>";
echo "<td bgcolor=#EEE8CD align=center><strong>Extension</strong></td>";
echo "<td bgcolor=#EEE8CD align=center><strong>Country</strong></td>";
echo "<td bgcolor=#EEE8CD align=center width=300><strong>Description</strong></td>";
echo "<td bgcolor=#EEE8CD align=center><strong>More Info</strong></td></tr>";
echo "<tr>";
echo "<td valign=top bgcolor=#FFFFFF width=180><strong>";
echo $myrow['extension_name'];
echo "</strong></td>";
echo "<td valign=top bgcolor=#FFFFFF align=middle>";
echo $myrow['country'];
echo "</td>";
echo "<td valign=top bgcolor=#FFFFFF>";
echo $myrow['description'];
echo "</td>";
echo "<td valign=middle align=center bgcolor=#D8D8D8 width=70><strong>";
echo "<a href='extensions.php?extension_id=$extension_id'>Details</a>";
echo "</table></strong></td></tr><br><br>";
}
while ($myrow=mysql_fetch_array($result));
}
else
{
echo "Sorry, no records were found.";
echo "<br><br><strong><font size=2 face=arial><img src='http://journeys-intl.com/images/arrow.gif' border=0 alt=arrow.gif><a href='javascript: history.go(-1)'> Back</a></font></strong>";
}
include ("http://journeys-intl.com/includes/footer2.html");
?>
</body>