stevebob Posted June 14, 2006 Share Posted June 14, 2006 I have a database drivensite and need to add an 'advanced search' function to it. The code below seems to work, but only if I have selected a value for each of the variables. If any are left empty then the results page shows no results. Is there a way to have the results show even if one variable has had no value. I have tried using for example and 'all genres' option on the search with a value of '0' or '-1' but this does not seem to work.SELECT *FROM performersWHERE gender = 'colname' AND genre LIKE '%colgenre%' AND voicetype LIKE '%colvoice'ORDER BY name ASCAlso, I am using drop-down lists at the moment. How can I set up the search to use multiple checkboxes for 'genre' and search for ANY of the selected - e.g. if you tick 'documentary' and 'corporate' it will look for both of those values in the 'genre' column, as well as the other variables.Hope you can help. I am new to database driven sites and this project has snowballed! Quote Link to comment https://forums.phpfreaks.com/topic/11988-multiple-variable-search-some-empty/ Share on other sites More sharing options...
moberemk Posted June 14, 2006 Share Posted June 14, 2006 Since you're posting in the Dreamweaver section, I'll assume that you are using Dreamweaver. If you are open to buying an extension, there is always the [a href=\"http://www.interaktonline.com/\" target=\"_blank\"]interAKT[/a] Site Search extension you could use. Quote Link to comment https://forums.phpfreaks.com/topic/11988-multiple-variable-search-some-empty/#findComment-45626 Share on other sites More sharing options...
stevebob Posted June 14, 2006 Author Share Posted June 14, 2006 Thanks.Does the extensiion work for only searches where you type in the variables? Or can it be configured for drop-down menus / checkboxes?Is there a way to do this without shelling out for an extenstion? Quote Link to comment https://forums.phpfreaks.com/topic/11988-multiple-variable-search-some-empty/#findComment-45676 Share on other sites More sharing options...
moberemk Posted June 15, 2006 Share Posted June 15, 2006 If there is, then I'm not the one to tell you. Sorry for not being able to help you with this. Quote Link to comment https://forums.phpfreaks.com/topic/11988-multiple-variable-search-some-empty/#findComment-45782 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.