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