affordit Posted February 6, 2008 Share Posted February 6, 2008 Is there a way to have 2 or more values in 1 field and be able to pull up that record using either value? Link to comment https://forums.phpfreaks.com/topic/89739-multiple-values-in-1-field-in-db/ Share on other sites More sharing options...
rhodesa Posted February 6, 2008 Share Posted February 6, 2008 If you want to have multiple values, you should use another table with a one-to-many relationship. But you do have other options: 1) Separate the values with a comma. Simple, but hard to search for values. 2) Use bit values. http://dev.mysql.com/doc/refman/5.0/en/bit-functions.html. More complicated, but better in the long run. Link to comment https://forums.phpfreaks.com/topic/89739-multiple-values-in-1-field-in-db/#findComment-459859 Share on other sites More sharing options...
affordit Posted February 6, 2008 Author Share Posted February 6, 2008 What I have is a products table that has a category field and I would like toadd anothe value to that field so that I can make certian item Featured items. Like category = toys and featured is there any easy way? Link to comment https://forums.phpfreaks.com/topic/89739-multiple-values-in-1-field-in-db/#findComment-459868 Share on other sites More sharing options...
p2grace Posted February 6, 2008 Share Posted February 6, 2008 Add a featured field to the database and have it be either a 1 or a 0 Link to comment https://forums.phpfreaks.com/topic/89739-multiple-values-in-1-field-in-db/#findComment-459870 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.