Solved

how to create relationships in mysql using phpMyAdmin

Posted on 2002-03-14
6
5,099 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

760 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

22 Experts available now in Live!

Get 1:1 Help Now