list categories
Posted: Tue Jan 12, 2010 5:16 am
Hi
If anyone could help with below code as I am new to php
above code list all cities as below
newyork
newyork
newyork
newyork
newyork
newyork
Washington
Washington
Washington
Washington
Washington
Washington
Seattle
Seattle
Seattle
Seattle
Seattle
Kansas
Kansas
Kansas
Kansas
Kansas
Kansas
Kansas
.... continue
but i want to list like below and when a city link is clicked, all the hotels in that city will display on a city Page using the appropriate template
Newyork
washington
seattle
kansas ....
any help much appreciate
Thanks
If anyone could help with below code as I am new to php
Code: Select all
<?php
$result = mysql_query("SELECT * FROM hotels ORDER BY city");
while($row = mysql_fetch_array($result))
{
echo $row['city'] . " " ;
echo "<br />";
}
?>newyork
newyork
newyork
newyork
newyork
newyork
Washington
Washington
Washington
Washington
Washington
Washington
Seattle
Seattle
Seattle
Seattle
Seattle
Kansas
Kansas
Kansas
Kansas
Kansas
Kansas
Kansas
.... continue
but i want to list like below and when a city link is clicked, all the hotels in that city will display on a city Page using the appropriate template
Newyork
washington
seattle
kansas ....
any help much appreciate
Thanks