need help please....

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Alidad
Forum Commoner
Posts: 29
Joined: Thu Mar 29, 2007 12:42 pm

need help please....

Post by Alidad »

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
Last edited by onion2k on Mon Sep 22, 2008 1:46 pm, edited 1 time in total.
Reason: Topic moved from the General "I couldn't be bothered to look for a folder so I stuck my topic in the first one" Forum to the Database folder.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: need help please....

Post by onion2k »

Assuming you have an id of some sort in the 'registered' table, sort the same id in the 'screen' table.
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: need help please....

Post by califdon »

You may find a basic tutorial on relational databases of value. Try:
http://www.geekgirls.com/databases_from_scratch_3.htm
http://parallel.vub.ac.be/documentation/database/tutor/

For your next forum post, please follow our forum rules and DO NOT use general Subjects, like "need help please". That tells us nothing about what area your problem may be in. As a result, many of the people who are best able to help you will simply skip over your post without reading, because we are looking for specific areas where we may be able to provide help.
Alidad
Forum Commoner
Posts: 29
Joined: Thu Mar 29, 2007 12:42 pm

Re: need help please....

Post by Alidad »

thank you onion2k, I'm getting there to underand, how do i can write relationship statments between two tables!

AM
Post Reply