Note that there are some explanatory texts on larger screens.

plurals
  1. POselect data from two or mre tables using php mysql
    primarykey
    data
    text
    <p>I need to implement a search function. I have two tables named <code>tbl_table</code> and <code>tbl_roomavailability</code>. I need to search for a hotel that is available for a particular date interval i.e., need to search if the room is available and also need to display the hotels from the hotel table. See my code:</p> <pre><code>SELECT DISTINCT( H.`int_hotel_id`), H.str_hotelName, H.str_logo_thumb, H.str_aboutHotel FROM tbl_hotel H INNER JOIN tbl_roomavailability RA ON H.int_hotel_id = RA.int_hotel_id WHERE bit_complete = 1 AND H.int_zone_id = 10 AND H.int_city_id = 1 AND H.int_hotelcatId = 3 AND RA.str_date IN (1334966400,1335052800,1335139200,1335225600,1335312000,1335398400,1335484800,1335571200,1335657600,1335744000) ORDER BY H.int_hotel_id DESC; </code></pre> <p>With this query i need to display the entire hotel id which matches the zone, city sate from <code>tbl_hotel</code>. Currently my results are the hotels which are present in the room availability table.</p> <p>I need to display both. i.e. need to check if the hotel is present in the room availability and also the hotels which are satisfied the other condition in the hotel table.</p> <p>Suppose I have 3 hotels</p> <p>Hotel 1 - state=7, zone=3 which is present in the room availability table<br> Hotel 2 State 7 zone=3 which is <strong>not present</strong> in the room availability<br> Hotel 3 state 8 zones 4 which is present in the room availability<br> Hotel 4 state 7 zone 3 which is <strong>present</strong> in the room availability but <strong>not available</strong> for several month </p> <p>When I search for a hotel with state 7 and zone 3, then I need to display hotel1 and hotel2 (I don't want to display the hotel 4 because it's not available for a several month).</p> <p>I think it's clear<br> Does anyone know?<br> Please reply</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload