Jump to content

Relational MySql


princeofpersia

Recommended Posts

Hi Guys

 

I have two table in mysql one is users and the second one is profiles

 

my database name is movies

 

users contains: users_id, username, password, email

 

movies contains: id, user_id, name, movie_name, movielink

 

 

I need users to login and then update their profile according to relational database setup

 

so once user loggs in they can add the link of their movies to the database.

 

 

Could some one help me with inserting data into relational database according to database setup I have introduced above?

 

Appreciate your help in advance ;)

Link to comment
https://forums.phpfreaks.com/topic/219691-relational-mysql/
Share on other sites

Your structure is wrong (probably).  What you really want is a table for Users (userid, username, etc) and atable for Movies (movieid, movieName, etc).  Then you want a cross-reference table that has movieId and userId.  This way, you're not duplicating the movie titles.  If 100 people like The Matrix, using your method you'd have 100 instances of the title "The Matrix" in your table.  Using mine, you'd only have one (plus 100 cross-reference rows).

 

Now, if you're asking "how do I go about making a dynamic website such as this," there are plenty of PHP tutorials out there.

 

-Dan

Link to comment
https://forums.phpfreaks.com/topic/219691-relational-mysql/#findComment-1139058
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.