Jump to content

Joining mysql table


boyee007

Recommended Posts

hi folks,

im new to this forum and not a PHP expert so handle me with care :)

 

Basiclly im trying to create a booking system based on daily time

 

ive got problem with joining multiple table!

got 5 tables to join

 

1. User

2. treatment

3. beautician

4. timeslot

5. bookslot

 

 

TIMESLOT table (15 minutes gap)
id_timeslot | times
-----------------------
1 | 10:00
2 | 10:15
3 | 10:30 
so on

 

BOOKSLOT table
id_bookslot | id_user | id_treatment | id_timeslot
1       |    24       |      2       |       2
2       |    25       |      1       |       2
3       |     24      |      4      |        3

 

$mysqli->query("SELECT * FROM bookslot RIGHT JOIN timeslot ON bookslot.id_timeslot = timeslot.id_timeslot 
			LEFT JOIN beautician ON bookslot.id_beautician = beautician.id_beautician");

14t7rb7.gif

 

as you can see on the image, its showing the correct results, except for the times because ive got 2 same id_timeslot in bookslot table

i want somthing  like in the table B (image)

 

there might somthing wrong on joining the table.

any help would be appriciated.

 

thanks in advance

 

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/221755-joining-mysql-table/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.