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) Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.