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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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