Website containing a list of media the user has watched, played, or read

Hi, I’m extremely new to PHP and MYSQL so hopefully my questions won’t be too hard to figure out. For my project I have to design a website and one of the functionalities that I want on my website is to add movies, books, or games to a list that the user has watched. Of course, I already have a database for each of those types of media with the title as the primary key. The user has a user_id as the primary key, and of course the username is unique. I’m not quite sure if I need to make a list database, and if I do, how I would make one. I suppose a simple image will help a lot.

http://imgur.com/gZj50

The PHP code for this section of the website is
[php]
while ($row = mysql_fetch_array($sql)){
echo ‘

’;
echo 'Title: '.$row[‘title’];
echo ’
Director: '.$row[‘director’];
echo ’
Date Released: '.$row[‘date_released’];
echo ’
Genre: '.$row[‘genre’];
echo ’
Running Time: '.$row[‘running_time’];
echo ‘

’;
echo ‘’;

if ($_SESSION[“logged”]) {
echo “<a href=“mylist.php”>Add this movie to mylist!
”;

}
[/php]

Of course, the Add this movie to mylist!, needs to be changed, because it just redirects to another php page and doesn’t take the title of the movie as a parameter, but I’m not sure what to do since I’m new to PHP. When the user clicks on that link, I want the ‘mylist’ portion of the website to be updated with that specific movie. It should show the list of movies, games and books that the user has watched, played or read. I do not know if I need a separate database for a list of media that the user has added to their list.

Try making a new table called list or a new field in the user table called list or could be a txt file list flatfile.

It depends how you want the list done to the code.
But do the books movies have ids as this would be eaiser to add to a mysql field ?

According to what Noodles Said,

you can create a new table and store every single record as new row, and assign an userID to every record to identify which user it belongs to.

eg:

UserID |movie |Books |Games

user2 movie0 books7 games12
user9 movie1 books7 games4
user5 movie3 books7 games7
user7 movie5 books7 games4
user2 movie2 books2 games2
user7 movie3 books4 games4
user1 movie3 books7 games5
user8 movie9 books5 games2

SELECT movies,books,games FROM tbl_name WHERE UserID='user2'

this query will return:

movie0  books7  games12
movie2  books2  games2
Sponsor our Newsletter | Privacy Policy | Terms of Service