Forums
This topic is locked
ASP Querystring sql help!
Posted 25 Apr 2006 08:30:28
1
has voted
25 Apr 2006 08:30:28 Marc McComiskey posted:
Hi im making a relatively simple website using asp.net in dreamweaver.Its a car ad site. Im making the search page for it using the usual fields make model price etc.
But im having trouble, i have drop down lists that have an option 'any' which i have set the value as "". eg 'Make' has the options any , bmw, ford.... So i can search for Any model of bmw for example.
Is there a way of telling my sql in my results page that is recieving the parameters for make and model that if make or model option is = "" then display all records. eg. in psuedocode.
If @make = "" then
'display all'
else car.make=@make
I have asked this in the sql section instead of the asp section as it would make my life easier to modify the sql.
I found a site which had the solution but i really dont understand it. search400.techtarget.com/tip/1,289483,sid3_gci965490,00.html
Im really new to this, but i have a deadline which its vital i meet.
I really would appriecate any help
Sonic
Replies
Replied 25 Apr 2006 11:47:14
25 Apr 2006 11:47:14 Roddy Dairion replied:
select * from table where make like '%your parameter here%'
Edited by - roders22 on 25 Apr 2006 11:48:11
Edited by - roders22 on 25 Apr 2006 11:48:11