how to link two records from different tables
Posted: Mon Mar 23, 2009 9:51 am
hi, i was wondering if there is a way to display two records from different tables.
i have two tables in MySQL which are title and words
title contains id (auto increment) and title
words contains id, title, translation.
what i want is to display all titles from table 'title' as links.
when the link is followed, it leads to the page which displays all the records in table 'words' which the title is same
for example,
records in table 'title'
1. id=1, title=book
2. id=2, title=apple
3. id=3, title=car
records in table 'words'
1. id=1, title=book, translation=книга
2. id=2, title=book, translation=kitob
3. id=3, title=apple, translation=яблока
4. id=4, title=car, translation=машина
in the index page it should show all records in title and when they are followed it show the records in table words (title and translation)
cuz there may be several translations for one title, i've separated them into two tables
would be great if someone could help on dis
i have two tables in MySQL which are title and words
title contains id (auto increment) and title
words contains id, title, translation.
what i want is to display all titles from table 'title' as links.
when the link is followed, it leads to the page which displays all the records in table 'words' which the title is same
for example,
records in table 'title'
1. id=1, title=book
2. id=2, title=apple
3. id=3, title=car
records in table 'words'
1. id=1, title=book, translation=книга
2. id=2, title=book, translation=kitob
3. id=3, title=apple, translation=яблока
4. id=4, title=car, translation=машина
in the index page it should show all records in title and when they are followed it show the records in table words (title and translation)
cuz there may be several translations for one title, i've separated them into two tables
would be great if someone could help on dis