FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


how to create a link on 2 tables in phpmyadmin mysql





pollux1er
hi to every body. I want to create a link on 2 tables in phpmyadmin. I have looked for and what i find out is the command "join" and "on". But i dont exactly know how it works.
I will take the example that i have 2 tables table1(name, age, location), and on table2(location, population, size). I want to create a link between table1 and table 2 by the data "location". What is the sql command to type, such that location on table1 and 2 should be the same.


Thanks to help me.
Stubru Freak
pollux1er wrote:
hi to every body. I want to create a link on 2 tables in phpmyadmin. I have looked for and what i find out is the command "join" and "on". But i dont exactly know how it works.
I will take the example that i have 2 tables table1(name, age, location), and on table2(location, population, size). I want to create a link between table1 and table 2 by the data "location". What is the sql command to type, such that location on table1 and 2 should be the same.


Thanks to help me.


Do you mean this:
Code:
SELECT table1.name, table1.age, table1.location, table2.population, table2.size FROM table1 INNER JOIN table2 ON table1.location = table2.location
cLean
be more specific for us do u want the link to show the info in the table for each line.. or do u want to show each row individually etc... jus tell us more of waht u want
pollux1er
What i need is to realize a link such that when i insert a data into the 'table1' on the field 'location' for example, which is the common link with 'table2', the data is store once in the both tables.

Is it possible?

I will first try the code of stubru freak.

thanks
Stubru Freak
pollux1er wrote:
What i need is to realize a link such that when i insert a data into the 'table1' on the field 'location' for example, which is the common link with 'table2', the data is store once in the both tables.

Is it possible?

I will first try the code of stubru freak.

thanks


My code is to retrieve that data. I don't know what you mean, why can't you just do 2 INSERT statements? Maybe take a look into foreign keys. (For InnoDB databases.)
pollux1er
You might be right, because i didn't see how it is possible yet. I will still search... Wink
Related topics
php admin and mysql admin console
phpmyadmin
Site Builder
Follow the user
Simple Question
mySQL create table problem (parse error)..
I cannot login PhpMyAdmin
PhpNuke Installation Tutorial
creating new tables (answered)
Auto create tables
Mysql datas gone!
Index page for images, putting them all on one page 50fri$!!
phpMyAdmin - MySQL Ext error...
Creating tables with Mysql queries
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.