tibberous Posted August 5, 2007 Share Posted August 5, 2007 I have a table full of dictionary words. I want to store them in another database by id. So, table one would have: WordID Cat1 Dog2 Boy3 And the second table would refer to words as the id in the first table. Is there some way I can make a query to the second table, and have it return the word value rather the id? (hope you guys get what I mean) Link to comment https://forums.phpfreaks.com/topic/63386-best-way-to-do-a-mysql-lookup-table/ Share on other sites More sharing options...
phpQuestioner Posted August 5, 2007 Share Posted August 5, 2007 use a MySQL Join http://www.tizag.com/mysqlTutorial/mysqljoins.php Link to comment https://forums.phpfreaks.com/topic/63386-best-way-to-do-a-mysql-lookup-table/#findComment-315942 Share on other sites More sharing options...
tibberous Posted August 5, 2007 Author Share Posted August 5, 2007 Thats what I was wanting and a good tutorial on it. Do you know if there is a way using subqueries? I remember I used to know subqueries, but I forgot them, and have trouble programming ever since. Link to comment https://forums.phpfreaks.com/topic/63386-best-way-to-do-a-mysql-lookup-table/#findComment-315964 Share on other sites More sharing options...
Barand Posted August 5, 2007 Share Posted August 5, 2007 Join would be much faster than subquery SELECT b.colname, a.word FROM table1 a INNER JOIN table2 b ON a.id = b.wordid Link to comment https://forums.phpfreaks.com/topic/63386-best-way-to-do-a-mysql-lookup-table/#findComment-315980 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.