Alidad Posted September 22, 2008 Share Posted September 22, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/125337-need-help-please/ Share on other sites More sharing options...
Maq Posted September 22, 2008 Share Posted September 22, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/125337-need-help-please/#findComment-647845 Share on other sites More sharing options...
Stefan Posted September 24, 2008 Share Posted September 24, 2008 I found that there is nothing like a good e.g So maybe this can help http://www.tizag.com/mysqlTutorial/mysqljoins.php Quote Link to comment https://forums.phpfreaks.com/topic/125337-need-help-please/#findComment-649384 Share on other sites More sharing options...
fenway Posted September 29, 2008 Share Posted September 29, 2008 Don't double-post next time. Quote Link to comment https://forums.phpfreaks.com/topic/125337-need-help-please/#findComment-653312 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.