How do I combine tables with SQL?
10:05 17 Feb 2016

Ok, I have two tables of information: movies & history. My movies db has all the information about the movies. These are the rows in movies: id, title, photo, destination, description, rating, length, likes.

My history db has all the information about what movies the user has clicked on. These are the rows in history: id, user_id, movie_id.

The Question

I'm working on a feature called "My History." How do I show their history but also get the information from the movies in one SQL query?

For example:

$db->query("SELECT * FROM movies ORDER BY TABLE history WHERE user_id='$id'");

I apologize if the answer seems simple. This is my first year working with programming in general. Thanks for any help give.

php mysql join