Have you tried
<?php
$query=mysql_query("SELECT * FROM `api_hotel`");
while($res=mysql_fetch_array($query)){
echo "<div class='banner'>".$res['hotel_name']."</div>";
}
?>
Sometime it makes a difference not sure in this scenario.
It would need some editing as I wasnt coding it for a database to be exact, nor have i tested it but it should work, oops if your using revcms that would work
Just a rough thing I did not completely sure if it will work but it should after you edit it to your needs ect.
$query = mysql_query('SELECT null FROM `users` WHERE `username` = $username;')
$fetch = mysql_fetch_array($query);
echo '<img...