Search Results

Search found 2 results on 1 pages for 'boyee007'.

Page 1/1 | 1 

  • PHP timeslot booking*

    - by boyee007
    regarding of this question.. PHP Booking timeslot I tried 'GROUP BY' id_timeslot still didnt work, as its only showing the booked timeslot not available i tried that solution, but give me an error and not quite understand how to use 'coelence' table timeslot (id_timeslot integer); table doctor (id_doctor integer); table bookslot (id_bookslot, id_doctor, id_timeslot integer); insert into doctor (id_doctor) values (1 = doc_A), (2 = doc_B), (3 = doc_C); insert into TimeSlot (id_timeslot) values (1 = 10:00:00), (2 = 10:15:00), (3 = 10:30:00), (4 = 10:45:00); insert into bookslot (id_doctor,id_timeslot) values (1,1), (1,5), (2,1), (2,4), (3,1); Join mysql table $q = $mysqli->query("SELECT * FROM bookslot RIGHT JOIN timeslot ON bookslot.id_timeslot = timeslot.id_timeslot LEFT JOIN doctor ON bookslot.id_doctor = doctor.id_doctor "); echoing result and checking if it matches todays date or else set available while($r = $q->fetch_array(MYSQLI_ASSOC)) : echo '<tr>'; echo '<td align="center">' . $r['times'] . '</td>'; if($r['booked_date'] == date('Y-m-d') && $r['id_doctor'] == 1): echo '<td><a href="#available" class="booked">booked</a></td>'; else : echo '<td><a href="#" class="available">available</a></td>'; endif; if($r['booked_date'] == date('Y-m-d') && $r['id_doctor'] == 2): echo '<td><a href="#available" class="booked">booked</a></td>'; else : echo '<td><a href="#" class="available">available</a></td>'; endif; if($r['booked_date'] == date('Y-m-d') && $r['id_doctor'] == 3): echo '<td><a href="#available" class="booked">booked</a></td>'; else : echo '<td><a href="#" class="available">available</a></td>'; endif; echo '</tr>'; endwhile; result from webpage and i want the result look like: id_timeslot doc_A doc_B doc_C ---------------------------------------------- 1 booked booked booked 2 available available available 3 available available available 4 available booked available 5 booked available available Any other solution please!

    Read the article

  • PHP Booking timeslot

    - by boyee007
    Im developing a php booking system based on timeslot for daily basis. Ive set up 4 database tables! Bookslot (which store all the ids - id_bookslot, id_user, id_timeslot) Timeslot (store all the times on 15 minutes gap ex: 09:00, 09:15, 09:30, etc) Therapist (store all therapist details) User (store all the members detail) ID_BOOKSLOT ID_USER ID_THERAPIST ID_TIMESLOT 1 10 1 1 (09:00) 2 11 2 1 (09:00) 3 12 3 2 (09:15) 4 15 3 1 (09:00) Now, my issue is, it keep showing repeation for timeslot when i want echoing the data for example: thera a thera b thera c ------------------------------------------------- 09:00 BOOKED available available 09:00 available BOOKED available 09:00 available available BOOKED 09:15 available BOOKED available as you can see, 09:00 showing three times, and i want something like below thera a thera b thera c ------------------------------------------------- 09:00 BOOKED BOOKED BOOKED 09:15 available BOOKED available There might be something wrong with joining the table or else. The code to join the table $mysqli->query("SELECT * FROM bookslot RIGHT JOIN timeslot ON bookslot.id_timeslot = timeslot.id_timeslot LEFT JOIN therapist ON bookslot.id_therapist = therapist.id_therapist" if anyone have the solution for this system, please help me out and i appriciate it much!

    Read the article

1