Suppose we have these 2 following tables:
reservations table: id, time, user_id
users table: id, name
When selecting reservations, how can I get the following output on pure MySQL without querying for the "user" manually on php for each reservation?
Because it gets really slow when looping through thousands of reservations.
{
id: 1,
time: "123456789",
user_id: 321,
user: {
id: 321,
name: John Doe
}
}