Well..complex..for me at least!
I have a table containing story's
All storys have one unique `storyID`
I have another table where I keep track of user's favorite story's.
This table has two columns `clientID`and `storyID`
after a while, you could end up having the following rows in favorite
Well..complex..for me at least!
I have a table containing story's
All storys have one unique `storyID`
I have another table where I keep track of user's favorite story's.
This table has two columns `clientID`and `storyID`
after a while, you could end up having the following rows in
JOIN is what you need.
http://www.mysql.com/doc/J/O/JOIN.html
Some examples:
mysql SELECT * FROM table1,table2 WHERE table1.id=table2.id;
mysql SELECT * FROM table1 LEFT JOIN table2 ON table1.id=table2.id;
mysql SELECT * FROM table1 LEFT JOIN table2 USING (id);
mysql SELECT * FROM table1