Jump to content

need help please...


Alidad

Recommended Posts

Perhaps someone can help me with an example I've come up with to help me to better understand how to build a relationship in Mysql.

 

I have database name “members” and two table name “registered” and “Screen”

 

Registered table:

 

First name

Last name

User name

Password

 

Screen table:

 

Title

Category

Date

Comments

 

What they do is that when member log in from registered table, then input information then send data to the Screen table.

 

Now I have two questions:

 

1) How would or SHOULD I go about creating the database relationship to show that the screen table is come from right user name!

 

2)  How do I create insert statement into the Screen table that come from right user name!

 

Please help thanks.

 

AM

 

Link to comment
https://forums.phpfreaks.com/topic/125337-need-help-please/
Share on other sites

Let's look at question #1:

 

1)  How would or SHOULD I go about creating the database relationship to show that the screen table is come from right user name!

 

You need to have a unique ID.  So in your users table have a field called, "id", and have it auto-increment.  You have to have a field in the SCREEN table called, "user_id" so it knows which id goes to each record.

Link to comment
https://forums.phpfreaks.com/topic/125337-need-help-please/#findComment-647845
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.