Solved

how to create relationships in mysql using phpMyAdmin

Posted on 2002-03-14
6
5,103 Views
Last Modified: 2010-08-05
Hai all,

I want to know how to create relationships between the tables in mysql using phpMyAdmin software.

Anyone who r familiar with it pls solve my problem

Thankyou
Manju

0
Comment
Question by:manju70
6 Comments
 
LVL 32

Expert Comment

by:Batalf
ID: 6867893
mySQL doesn't support physical relations between tables. It only support the syntax(create table.....references) to make it easy to transfer a db from an other db-system to mySQL.

But: mySQL is still a relational database management system(RDBMS), but the relations between tables are not physical. If I have 2 tables

"score"
ID int
studentID int
score varchar(5)

and the table "student"
ID int
firstname varchar(32)
lastname varchar(32),

they stand alone without a physical connection. But with the studentID in the table score I have constructed the tables as if there were a physical relation between them, and I could use SQL-querys as in other DB_systems.
0
 

Author Comment

by:manju70
ID: 6868432
At first I thank, for your comments.
but, if I wanted to load data in a foreign key field then how am I to ensure whether the corresponding primary key field is available in master table(like in Ms access ).

if mysql doesn't supports this features,is any other free software which supports it is available?????

thanks in advance
manju
0
 

Expert Comment

by:esnagel
ID: 6870102
If you have two tables:

users
~~~~~
userID
username
password

demographics
~~~~~~~~~~~~
userID
age
sex
race

Your SQL query would be:  "select * from users, demographics where users.userID=demographics.userID" to get the data from both tables

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 5

Expert Comment

by:dkjariwala
ID: 6870559
but, if I wanted to load data in a foreign key field then how am I to ensure whether the corresponding
primary key field is available in master table(like in Ms access ).


You should be using JOINS to do this.

My friend esnagel has suggested you how do to same using LEFT JOIN.

But if you want more features Try PostGRE SQL.

http://www.at.postgresql.org/

JD
0
 

Accepted Solution

by:
Zuhair070699 earned 30 total points
ID: 6876027
I am using Mysql Manager program to do relationships between tables.

You can download full function 30 day trial version from here:

http://ems-hitech.com/mymanager/download.phtml
0
 
LVL 5

Expert Comment

by:dkjariwala
ID: 6876049
Zuhair

thats heck of a software !!!
JD
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now