shedokan Posted December 1, 2007 Share Posted December 1, 2007 I have a table called items with two columns one called id and the other one called catagory. is it possible to have two catagories to one item? Link to comment https://forums.phpfreaks.com/topic/79641-solved-is-it-possible-to-have-multiple-values-to-the-same-column/ Share on other sites More sharing options...
fenway Posted December 2, 2007 Share Posted December 2, 2007 If you mean multiple categories per record, then the answer is "no" -- what you need to do is have 3 tables -- one of items, one of categories, and a 3rd relational table that links the two IDs in unique pairs. This way, each item can have multiple categories. Link to comment https://forums.phpfreaks.com/topic/79641-solved-is-it-possible-to-have-multiple-values-to-the-same-column/#findComment-404182 Share on other sites More sharing options...
shedokan Posted December 2, 2007 Author Share Posted December 2, 2007 isn't it better to have a column called catagory_2? if yes so how can I do it his way Link to comment https://forums.phpfreaks.com/topic/79641-solved-is-it-possible-to-have-multiple-values-to-the-same-column/#findComment-404419 Share on other sites More sharing options...
fenway Posted December 3, 2007 Share Posted December 3, 2007 isn't it better to have a column called catagory_2? if yes so how can I do it his way No it's not better... what about when there are 3? You're going to add another field? Or 100? Link to comment https://forums.phpfreaks.com/topic/79641-solved-is-it-possible-to-have-multiple-values-to-the-same-column/#findComment-405053 Share on other sites More sharing options...
shedokan Posted December 4, 2007 Author Share Posted December 4, 2007 who said I need 100 maybe I need just 10? never mind I added a colmn called catagory 2 and tat's it. your'e trying tomake it the hard way. Link to comment https://forums.phpfreaks.com/topic/79641-solved-is-it-possible-to-have-multiple-values-to-the-same-column/#findComment-406254 Share on other sites More sharing options...
fenway Posted December 4, 2007 Share Posted December 4, 2007 who said I need 100 maybe I need just 10? never mind I added a colmn called catagory 2 and tat's it. your'e trying tomake it the hard way. Acutally, you're doing in the hard way... but I won't say I told you so. Link to comment https://forums.phpfreaks.com/topic/79641-solved-is-it-possible-to-have-multiple-values-to-the-same-column/#findComment-406259 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.