ShoeLace1291 Posted August 30, 2010 Share Posted August 30, 2010 I have two tables. Let's call the first one items and the second one item categories. Now the items table would look something like this: id(auto_increment id) name description categoryid The item categories table would look something like this: categoryid name description An entry in the items table would look something like this: categoryid = 1,2 name = Thing description = something id = 1 Say I want to retrieve records that contain "1" in the categoryid column. How would I do that? Link to comment https://forums.phpfreaks.com/topic/212052-linking-database-tables-with-csv/ Share on other sites More sharing options...
jcbones Posted August 30, 2010 Share Posted August 30, 2010 This should work: SELECT * FROM table WHERE 1 IN(`categoryid`); Link to comment https://forums.phpfreaks.com/topic/212052-linking-database-tables-with-csv/#findComment-1105082 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.