Here’s a list of hotel rooms that are under $100 a night.
$db = mysql_connect ("localhost", "wpkath", "kathika01");
mysql_select_db ("wpkath", $db);
//get the distinct state
$query = "select distinct state from blockbusters where country = 'US' and price < 101 order by state";
//execute query
$result = mysql_query($query);
//get the number of results
$num = mysql_num_rows($result);
$numb = intval($num/2);
//set up state abbr conversion
$states = "Alaska,Alabama,Arkansas,Arizona,California,Colorado,Connecticut,Delaware,Florida,Georgia,Hawaii,Iowa,Idaho,Illinois,Indiana,Kansas,Kentucky,Louisiana,Massachusetts,Maryland,Maine,Michigan,Minnesota,Missouri,Mississippi,Montana,North Carolina,North Dakota,Nebraska,New Hampshire,New Jersey,New Mexico,Nevada,New York,Ohio,Oklahoma,Oregon,Pennsylvania,Rhode Island,South Carolina,South Dakota,Tennessee,Texas,Utah,Virginia,Vermont,Washington,Wisconsin,West Virginia,Wyoming,District of Columbia";
//list abbreviations
$abb = "AK,AL,AR,AZ,CA,CO,CT,DE,FL,GA,HI,IA,ID,IL,IN,KS,KY,LA,MA,MD,ME,MI,MN,MO,MS,MT,NC,ND,NE,NH,NJ,NM,NV,NY,OH,OK,OR,PA,RI,SC,SD,TN,TX,UT,VA,VT,WA,WI,WV,WY,DC";
//create arrays
$states_array = explode(",", $states);
$abb_array = explode(",", $abb);
$sl = range(1,$num);
$sn = range(1,$num);
echo '
for ($i=0;$i< $num;$i++) { //step thru the results listing by state and building a table with links $row = mysql_fetch_array($result); $state = stripslashes($row['state']); $sl[$i] = $state; for($k=0;$k //echo $abb_array[1]; if($state == $abb_array[$k]){$state = $states_array[$k];} } $sn[$i] = $state; //echo to screen “; //if is midpoint new table cell |
} echo “ |
“;
echo ‘
![]()
‘;
for ($i=0;$i< $num;$i++)
{
$query = "select city,state,prop_name,prop_code,price from blockbusters where country = 'US' and state = '".$sl[$i]."' ";
//$price modifier
$query = $query . " and price < 101 ";
$query = $query . " order by state,city,price";
//echo ($query);
$result = mysql_query($query);
$numb = mysql_num_rows($result);
$cityname = "";
echo '
| ‘.$sn[$i].’ | |
|---|---|
| “; echo ““; echo $name . ” ” . $city . “, “.$sn[$i]; |
“; echo “$”.$price .” per night”; echo “ |
“;
echo ‘
![]()
‘;
}
?>
Subscribe
Tags: Travel Deals
Categories: Travel Deals

















Comments on this entry are closed.