Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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