PDA

View Full Version : How to add checkboxes to refine search database


Hemangi
05-05-2009, 07:20 AM
HI,

I have web site where user should search by multiple parameters, text field and checkboxes. I have made the keyword search just searching my database table rows for word that matches input URL parameter from the text field.
But I need to add to this form checkboxes which will refine the search. For example they can search for brick pavers in the text field and then check Search in North of the river, South of the river and so on areas. Can anyone please help me with the code. What do I need to write in the form code to pass the values of the checkboxes and how to set up this advanced recordset to display results based on both keyword and/or selected checkboxes.
Thanks in advance to whoever can help me.

Regards,
Hemangi

edbr
05-05-2009, 07:50 AM
when you saty recordset , is this an indication that you are using DW to code your query?
what databse are you using.
a hint that may help you is && is AND, || is OR

Hemangi
05-05-2009, 08:14 AM
I am using Dreamweaver with PHP and MySQL, I tried adding a second variable to the recordset(which to hold information from the checkboxes) and using it with AND and OR statement in the advanced recordset panel but it returned speling SQL error and on top of that creates completely new variable called $totalRows , and deletes the run time value of one of my variables. I tried several things like using AND and then OR in the statment but it was frustrating because it won't let me even preview it because no mater how many times I delete this $totalRows it still came and deletes run time value of the other var, so it is like magic circle. Ones this started all my errors were based on "run time value missing" or something of this kind. Any clues....?

edbr
05-05-2009, 08:55 AM
yes walk away form DW code and write yur own. Im sorry to ay but DW code is good for what it does but stray from its bags of tricks and it gets confusing. check out the tutorials on this site, it will help you

Hemangi
05-05-2009, 09:06 AM
What site? Maybe you forgot to put the link. I am just a designer and now came a task involving code which is difficult for me.

Corrosive
05-05-2009, 12:07 PM
What site? Maybe you forgot to put the link. I am just a designer and now came a task involving code which is difficult for me.

On this site... as in 'Dreamweaver Club'.

davidj
05-05-2009, 01:04 PM
What site? Maybe you forgot to put the link

http://www.dreamweaverclub.com/vtm/php-mysql-apache.php

Day 12 and I think I may have a touch of Swine Flu!

did you come out in rashers?

Corrosive
05-05-2009, 01:46 PM
did you come out in rashers?

I'd hate to think you weren't taking this seriously DJ :wink: