Dimwhit Posted February 7, 2008 Share Posted February 7, 2008 I'm self-taught in all this, and as such, I know very little. Here's what I'm working with: - adoption-related website with records of families wanting to adopt. They've listed gender, age, and number of children preferences. I'm looking for a way to sort through these records based on those criteria. Here's what I have so far: - I'm able to do most of this by passing the variable through the url. For example view.php?gender=Girl&age=LT9 Will return only records of families looking to adopt a girl under 9 years old. So I now have 2 questions. 1. Can I pass an 'OR' function this way? The gender options are Boy, Girl, and Either, so I need to be able to pass 2 of those. e.g. view.php?gender=Girl OR gender=Either. I'm not sure how to do that, or if there's even a way. Maybe I need to input the data into the db differently in the first place. 2. I'd like a simple form where the age, gender, and number if children can be entered, then sorted. I've tried to find some tutorials explaining this, but I haven't found any that I've been able to understand. I'm not looking for someone here to give me a detailed explanation on how to do it...just to maybe point me to a tutorial that's geared toward relative newbies like me. Link to comment https://forums.phpfreaks.com/topic/89937-user-end-record-sorting-plus-another-question/ Share on other sites More sharing options...
amites Posted February 7, 2008 Share Posted February 7, 2008 simple when you think about it pass the "Gender" variable through a series of if / then / else statements if ($_REQUEST['Gender'] == 'girl') { ... } elseif ($_REQUEST['Gender'] == 'bou') { ... } else { ... } lots of things you can do inside of that framework Link to comment https://forums.phpfreaks.com/topic/89937-user-end-record-sorting-plus-another-question/#findComment-461081 Share on other sites More sharing options...
phpSensei Posted February 7, 2008 Share Posted February 7, 2008 simple when you think about it pass the "Gender" variable through a series of if / then / else statements if ($_REQUEST['Gender'] == 'girl') { ... } elseif ($_REQUEST['Gender'] == 'bou') { ... } else { ... } lots of things you can do inside of that framework lol Whats a bou? Link to comment https://forums.phpfreaks.com/topic/89937-user-end-record-sorting-plus-another-question/#findComment-461090 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.