Jump to content

ltoto

Members
  • Posts

    162
  • Joined

  • Last visited

    Never

Everything posted by ltoto

  1. for example like this: [code]while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){   $name = $row['hotelName'];   $description = $row['hotelDescription'];   $rating = $row['hotelRating'];       $image = "<img src=\"../thumb/phpThumb.php?src=../images/hotel_{$row['hotelImage']}&w=100&h=100&zc=1\"  alt=\"Hotel\">";  $star = if ($row['hotelRating'] == 3){ $star = "star.gif"; } else if ($row['hotelRating'] == 4){ $star = "star2.gif"; } else if ($row['hotelRating'] == 5){ $star = "star3.gif"; } // List the hotels echo "<div class=\"homebar2\"><h1>".$name."</h1></div><div class=\"hotel\">".$image."</div><div class=\"hotelcontent\">".$description."</div><h3><img src=\"".$star."\" hspace=\"2\"></h3> ?> mysql_free_result($rsHotels); ?>[/code]
  2. this is what i have done: [code]while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){   $name = $row['hotelName'];   $description = $row['hotelDescription'];   $rating = $row['hotelRating'];       $image = "<img src=\"../thumb/phpThumb.php?src=../images/hotel_{$row['hotelImage']}&w=100&h=100&zc=1\"  alt=\"Hotel\">";        if ($row['hotelRating'] == 3){ //echo '<img src="star.gif" hspace="2">' } else if ($row['hotelRating'] == 4){ //echo '<img src="star2.gif" hspace="2">' } else if ($row['hotelRating'] == 5){ //echo '<img src="star3.gif" hspace="2">' }     // List the hotels   echo " <div class=\"homebar2\"><h1>".$name."</h1></div><div class=\"hotel\">".$image."</div> <div class=\"hotelcontent\">".$description."</div><h3>".$rating."</h3> \n"; }[/code] any ideas of where to put these bits which are in it       if ($row['hotelRating'] == 3){ //echo '<img src="star.gif" hspace="2">' } else if ($row['hotelRating'] == 4){ //echo '<img src="star2.gif" hspace="2">' } else if ($row['hotelRating'] == 5){ //echo '<img src="star3.gif" hspace="2">' } anu suggestions?
  3. What i want to do is not a system where people can rate, but something where there will be a hotel which is  stars, so i would want to show four stars , or if it is 5 i would want to show 5. this is the code of the page i would want to use it on: [code]<?php mysql_select_db($database_conTotal, $conTotal); $query_rsHotels = "SELECT * FROM tabHotel"; $rsHotels = mysql_query($query_rsHotels, $conTotal) or die(mysql_error()); $row_rsHotels = mysql_fetch_assoc($rsHotels); $totalRows_rsHotels = mysql_num_rows($rsHotels); $sql="SELECT * FROM tabHotel WHERE regionId = $id"; $result = mysql_query($sql); if (!$result) {   die('Invalid query: ' . mysql_error()); } while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){   $name = $row['hotelName'];   $description = $row['hotelDescription'];   $rating = $row['hotelRating'];       $image = "<img src=\"../thumb/phpThumb.php?src=../images/hotel_{$row['hotelImage']}&w=100&h=100&zc=1\"  alt=\"Hotel\">";        // List the hotels   echo " <div class=\"homebar2\"><h1>".$name."</h1></div><div class=\"country\">".$image."</div> <div class=\"hotelcontent\">".$description."</div><h3>".$rating."</h3>\n"; } mysql_free_result($rsHotels); ?>[/code] i would want to you it on the $rating part in the backend of the site, the CMS, they can choose the ration via a drop down menu, either 3 start, 4 star or 5 start the code for the dropdown is this: [code]<select name="selectRating" id="selectRating" title="<?php echo $row_rsAccomedit['hotelRating']; ?>">               <option value="3">3 Star</option>               <option value ="4">4 Star</option>               <option value ="5">5 Star</option>             </select></td>           </tr>           <tr>             <td><input name="hidId" type="hidden" id="hidId" value="<?php echo $row_rsAccomedit['Id']; ?>"></td>             <td><input name="Submit" type="submit" class="btn" value="Edit"></td>           </tr>         </table>         <input type="hidden" name="MM_update" value="form1">[/code] any ideas?
  4. i made the mistake sorry just spotted it, i did something wrong is the rs, now its just being a nightmare to line up
  5. i did this after your advice echo  "<div class='\country\'>".$image." <div class='\homebar2\'>".$name." ".$rating." ".$description."</div> \n"; } but it brings the footer up for some reason
  6. so if i wanted to put a new div tag in id say do this echo  "<div class='country'>".$image." ".$name." ".$rating." <div class='description'>".$description."</div> \n";
  7. right, i will give this a go and let you know how i get on, thanks a lot
  8. add they work now, thanks a lot
  9. im going to style each one  i did this [code]echo "<div class="content">".$image." ".$rating." ".$description."</div><br />\n";[/code] but i got a parse error which is this Parse error: parse error, unexpected T_STRING, expecting ',' or ';'
  10. I want to style the $name in this, so i want to put a div ta around it, but I am unsure of how to put the div tag or where to put it [code]while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){   $name = $row['hotelName'];   $description = $row['hotelDescription'];   $rating = $row['hotelRating'];       $image = "<img src=\"../thumb/phpThumb.php?src=../images/hotel_{$row['hotelImage']}&w=100&h=100&zc=1\"  alt=\"Hotel\">";        // List the hotels   echo "$image  $name  $rating  $description<br>   \n"; }[/code] any suggestions?
  11. What I am im doing is there is an initial form where they can fil in the details required, and then there will be an option to select, Villa, Hotel or Appartments ( the type of accomodation they want and after they sumbit the first form, depending on what option of them three they chose it goes through to another form. what i need to know is how to get the details of the form into the database if that makes sense, but also the person who is filling in the form will be given a reference number( kinda how a data is done ) which will follow them through both forms. any ideas or do i need to give more information?
  12. I was just wondering how to style the country Id part in this code [code]<?php $sql="SELECT c.countryName, c.countryImage, 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 (strcmp($country,$cheader) !=0){       $country = $row['countryName'];       echo <<<HTML           <br>               <div class="homebar2"><h1>$cheader</h1></div> <div class="country">  <img src="../thumb/phpThumb.php?src=../images/country_{$row['countryImage']}&amp;w=100&amp;h=100&amp;zc=1"  alt="Latest Deals">  </div>          HTML;   } echo <<<HTML   <a href="index.php?Id=16&id={$row['Id']}">{$row['regionName']}</a><br> HTML; } ?>[/code] so i want to style the regions basically
  13. Im trying not to double post, although i just did, this is the image code now [code]<img src=../images/country_{$row['countryImage']>[code] and this is the error Parse error: parse error, unexpected '<' in and thisis the code from the whole page [code]<?php mysql_select_db($database_conTotal, $conTotal); $query_rsHotels = "SELECT * FROM tabHotel"; $rsHotels = mysql_query($query_rsHotels, $conTotal) or die(mysql_error()); $row_rsHotels = mysql_fetch_assoc($rsHotels); $totalRows_rsHotels = mysql_num_rows($rsHotels); $sql="SELECT * FROM tabHotel WHERE regionId = $id"; $result = mysql_query($sql); if (!$result) {   die('Invalid query: ' . mysql_error()); } while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){   $name = $row['hotelName'];   $description = $row['hotelDescription'];   $rating = $row['hotelRating'];   $image =  <img src=../images/country_{$row['countryImage']>        // List the hotels   echo "$name  $image  $rating  $description<br>   \n"; } mysql_free_result($rsHotels); ?>[/code] sorry that i keep updating this topic just that it is quite Urgent now[/code][/code]
  14. ahhh that is working now, i see what i was doing wrong now, thanks a lot i just need to sort it out on this page now [code]<?php mysql_select_db($database_conTotal, $conTotal); $query_rsHotels = "SELECT * FROM tabHotel"; $rsHotels = mysql_query($query_rsHotels, $conTotal) or die(mysql_error()); $row_rsHotels = mysql_fetch_assoc($rsHotels); $totalRows_rsHotels = mysql_num_rows($rsHotels); $sql="SELECT * FROM tabHotel WHERE regionId = $id"; $result = mysql_query($sql); if (!$result) {   die('Invalid query: ' . mysql_error()); } while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){   $name = $row['hotelName'];   $description = $row['hotelDescription'];   $rating = $row['hotelRating'];   <img src="../images/hotel_{$row['hotelImage']}" >     // List the hotels   echo "$name - $rating - $description<br>   \n"; } mysql_free_result($rsHotels); ?>[/code]
  15. tabCountry= Id countryName countryImage tabRegion= Id regionName countryId and this is the image code now [code]<img src="../thumb/phpThumb.php?src=../images/country_<?php echo $row_rsCountry['countryImage']; ?>&amp;w=100&amp;h=100&amp;zc=1"  alt="Hotels">[/code]
  16. [code]while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){   $name = $row['hotelName'];   $description = $row['hotelDescription'];   $rating = $row['hotelRating'];   $image = $row "<img src="../images/country_ <?php echo $row_rsCountryedit ['countryImage']; ?>">";     // List the hotels   echo "$name - $rating - $description<br>\n"; } [/code] what do i need to change in the in the img bit to get it to work and also i did the image thing in this code and it didnt work [code]<?php $sql="SELECT c.countryName,c.countryImage, 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>         <div class="homebar2"><h1>$country</h1></div> <img src="../images/country_<?php echo $row_rsCountryedit['countryImage']; ?>"> HTML;   } echo <<<HTML   <a href="index.php?Id=16&id={$row['Id']}">{$row['regionName']}</a><br> HTML; } ?> [/code]
  17. would that not show the Image name e.g 1158573641admin_hotel.jpg instead of the image
  18. [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>         <div class="homebar2"><h1>$country</h1></div> HTML;   } echo <<<HTML   <a href="index.php?Id=16&id={$row['Id']}">{$row['regionName']}</a><br> HTML; } ?>[/code] I basically just want to add the code the the country image into this code, the image code is: [code] <img src="../images/country_<?php echo $row_rsCountry['countryImage']; ?>" [/code]
  19. What I am im doing is there is an initial form where they can fil in the details required, and then there will be an option to select, Villa, Hotel or Appartments ( the type of accomodation they want and after they sumbit the first form, depending on what option of them three they chose it goes through to another form. what i need to know is how to get the details of the form into the database if that makes sense, but also the person who is filling in the form will be given a reference number( kinda how a data is done ) which will follow them through both forms
  20. ahh yes, i accidently missed the first Id out which was confusing me, but it is working fine now, thanks a lot man
  21. ahhh i think i understnad now, i think the only bit that confuses me is what i put before the 2nd id
  22. im a little bit confused by what you mean by that, or maybe im missing somethign when i am reading it
  23. [code]"{$_SERVER['PHP_SELF']}?Id=16?id={$row['Id']}">{$row['regionName']}[/code] so as you can see i have 2 ids on one line,because i want it to first go to index.php?Id=16, because this is what page i want it to appear on, and then on that page i want id={$row['Id']}">{$row['regionName'] this bit to show up.
  24. i was thinking that if i added a new page, then all we would need to do is change the include so that in it it has index.php?Id=16 (this would be the hotelistpage) so i thought i could some hwo add that to this <? if  (isset($_GET['id'])){   $id = $_GET['id'];   include('pages/hotels.php'); } ?> and also have to change this link here aswell "{$_SERVER['PHP_SELF']}?id={$row['Id']}">{$row['regionName']} any suggestions anyone ? or do i need to go into more detail
  25. this is how it is in the sql tabPages: id pagesTitle pagesName pagesContent pagesDate then on the menu in the front end i have the names of the pages listed, for the menu  but not in a repeat region because ihave used different icons for each menu image,
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.