Jump to content


Photo

Need help again


  • Please log in to reply
23 replies to this topic

#21 Benbow08

Benbow08

    Young Padawan

  • Members
  • Pip
  • 63 posts

Posted 13 September 2006 - 10:23 AM

Im using php 4.6 no 5

#22 Benbow08

Benbow08

    Young Padawan

  • Members
  • Pip
  • 63 posts

Posted 14 September 2006 - 05:06 AM

i looked up some tutorials and stuff and read about this kind of stuff, and it is now working with this code

<?php

$sql="SELECT c.countryName, r.regionName, r.Id FROM tabCountry c, tabRegion r WHERE c.Id = r.countryId";
$result = mysql_query($sql);
if (!$result) {
   die('Invalid query: ' . mysql_error());
}
$country = "null";
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){
   $cheader = $row['countryName'];
   if (is_null($country) || strcmp($country,$cheader) !=0){
	  $country = $row['countryName'];	
	  echo <<<HTML
		<br>
		 <h2>$country</h2>
HTML;
   }
echo <<<HTML
   <a href="hotels.php?regionid=$row[Id]">$row[regionName]</a><br>
HTML;
}
?>

Edited by Benbow08, 14 September 2006 - 08:08 AM.


#23 Benbow08

Benbow08

    Young Padawan

  • Members
  • Pip
  • 63 posts

Posted 14 September 2006 - 10:30 AM

indeed it has, i am now just working on the bit that when they click on the region, it goes to just the hotels withi the region,


i think the good thing is though now i understand it more, and actually know what i am doing a bit mroe

#24 Benbow08

Benbow08

    Young Padawan

  • Members
  • Pip
  • 63 posts

Posted 14 September 2006 - 10:42 AM

but then again it didnt take much considerin i didnt understand much haha




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users