0

I want to take all the data from two tables with the same user_id, but I don't know what type of join to use and I want to be sure with the syntax of the query.

"users" table: enter image description here

"schedule" table:

enter image description here

Your Common Sense
  • 156,878
  • 40
  • 214
  • 345
Kent Abrio
  • 445
  • 2
  • 9
  • 27

1 Answers1

1

Here's a simple LEFT JOIN example:

SELECT * FROM `users` LEFT JOIN `schedule` ON `users`.`userid` = `schedule`.`user_id` 
WHERE `users`.`userid` = ?

this will collect everything from both tables and then you can output it accordingly.

Your Common Sense
  • 156,878
  • 40
  • 214
  • 345
Option
  • 2,605
  • 2
  • 19
  • 29