Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<html>
<head>
<title>get hotel XML
</title>
</head>
<body>
<?php
$dbcnx = @mysql_connect('localhost', 'username', '*****');
if (!$dbcnx) {
die( '<p>Unable to connect to the database server at this time.</p>' );
}
// Select the jokes database
if (! @mysql_select_db('hotelInfo') ) {
die( '<p>Unable to locate the grus database at this time.</p>' );
}
$id=$_GET['id'];
// get description info from description table in db
$descript = @mysql_query("select * from description where HotelID=$id");
if (!$descript) {
die('<p>Error performing query: ' . mysql_error() .'</p>');
}
while ( $row = mysql_fetch_array($descript) ) {
echo ('<?xml version="1.0" encoding="ISO-8859-1"?>')
echo ('<hotels>');
echo ('<hotel>');
echo ('<hotelID>'.$row['HotelID'].'<hotelID>');
echo ('<MarketingLevel>'.$row['MarketingLevel'].'</MarketingLevel>');
echo ('<PropertyDescription>'.$row['PropertyDescription'].'</PropertyDescription>');
echo ('</hotels>');
echo ('</hotel>');
}
?>
[red]header('Content-Type: text/xml');[/red]
while ($row = mysql_fetch_[red]assoc[/red]($descript)) {
echo '<?xml version="1.0" encoding="ISO-8859-1"?>'[red];[/red]
echo '<hotels>';
echo '<hotel>';
echo '<hotelID>'.$row['HotelID'].'<hotelID>';
echo '<MarketingLevel>'.$row['MarketingLevel'].'</MarketingLevel>';
echo '<PropertyDescription>'.$row['PropertyDescription'].'</PropertyDescription>';
echo '</hotels>';
echo '</hotel>';
}