richclever Posted May 1, 2007 Share Posted May 1, 2007 Hi, I have a form that has a multiple select and I need to search multiple mysql fields using the data that is passed using the form but am not too sure how to go about it. the form uses prop_type[] to hold the array of values, then I need to search 5 database fields with each of the array values (the form also has other items that are included in the search). There can be upto 10 values in the array that is passed from the form so the potential of 50 different combinations. I really need to do it in one query but really have got stuck. Can any one help? Thanks, Richard Link to comment https://forums.phpfreaks.com/topic/49415-multiple-select-form-and-search-multiple-database-fields/ Share on other sites More sharing options...
ToonMariner Posted May 1, 2007 Share Posted May 1, 2007 use the information sent to construct your query string based on a series of if (or switch) statements and for loops. concatenate all these together and use it in the query. Apologize but the explanation is a little difficult to grasp. Perhaps some code, db structure would come in handy... Link to comment https://forums.phpfreaks.com/topic/49415-multiple-select-form-and-search-multiple-database-fields/#findComment-242151 Share on other sites More sharing options...
richclever Posted May 1, 2007 Author Share Posted May 1, 2007 I see what you mean, just came to the same conclusion myself but great to have it confirmed. Link to comment https://forums.phpfreaks.com/topic/49415-multiple-select-form-and-search-multiple-database-fields/#findComment-242163 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.