OldWest Posted December 11, 2010 Share Posted December 11, 2010 i have a small query system i am working on. simply put, when the form will run a query on several results, one of which is age. the age must be entered manually in a text field (on the user end when doing the search). now. the results that output will be reliant on that age BUT there are age ranges. for example, i have ranges of: 0-19, 20-24, over 65, under 65 etc and kind of random about this. and if i enter the my age as 22 in the search field, positive matches would of course be 20-24 and under 65. i have tables: product and age. each product has an age range or a plus range (like over 65). so all products would be returned that match the age entered (of course which products have a matching age_range_id) i hope my question is clear. I am basically trying to resolve how my table relationship and structure should be to best accommodate this type of querying or a better solution altogether. thanks for any advice Link to comment https://forums.phpfreaks.com/topic/221270-normalization-age-ranges-options-not-sure-of-best-approach/ Share on other sites More sharing options...
fenway Posted December 11, 2010 Share Posted December 11, 2010 Store this as min/max values, with a text label. Link to comment https://forums.phpfreaks.com/topic/221270-normalization-age-ranges-options-not-sure-of-best-approach/#findComment-1145902 Share on other sites More sharing options...
OldWest Posted December 11, 2010 Author Share Posted December 11, 2010 Store this as min/max values, with a text label. Thanks for the tip. But I am not totally sure what you mean by min/max value and text label? Do you mean store the range in two separate text fields min and max? Link to comment https://forums.phpfreaks.com/topic/221270-normalization-age-ranges-options-not-sure-of-best-approach/#findComment-1145912 Share on other sites More sharing options...
fenway Posted December 12, 2010 Share Posted December 12, 2010 Correct. Link to comment https://forums.phpfreaks.com/topic/221270-normalization-age-ranges-options-not-sure-of-best-approach/#findComment-1146317 Share on other sites More sharing options...
OldWest Posted December 13, 2010 Author Share Posted December 13, 2010 Thanks for the insight. SOLVED Link to comment https://forums.phpfreaks.com/topic/221270-normalization-age-ranges-options-not-sure-of-best-approach/#findComment-1146742 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.