![]() |
Searching with multiple options
I have run into a problem with an app I am working on. I am trying to do a search. I had the basic search down, but I am trying to let people search with multiple options, basically searching in certain fields. If you can point me in the right direction, then many thanks.
Basically, I have an auto database; a stock number, a manufacturer, a model, vin, price, and a year. User can search and I have checkboxes for each of these to include in the search. I just can't figure out how to form the query. I tried joining them with .= and the ||, but not working right. Basically, I had the intial SELECT FROM WHERE, then checked if each post was set and if so conjoined the query with .= .. Code:
$query = "SELECT stock_number, manufacturer, model, price, vin, year FROM #__inventory WHERE ";Can anyone help advise on this? |
|| doesn't work in mysql, use OR
|
Ok, thanks. Actually figured this out with the help of someone... Here was the solution...
Code:
$where = array(); |
|
| All times are GMT. The time now is 11:18 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0