Question
Using Radio Button for Search
Hi,
I'm doing a Search function which consists of a category which i which to use radio buttons.
E.g. 4 Radio buttons.
Category A
Category B
Category C
Category D
and some other controls like a menu and a text box.. (which consists of the other criterias i need for the search...)
I was able to do the SQL on the menu. I retrieve the selected value in the menu and do a SQL to display the results.
But how could I get the radio button to do the same thing?
These radio buttons are actually tables in my database . (E.g Category A is a table in my database, Category B is another table....)
I did the SQL for the menu and the textbox like this...
my menu name is : myMenu
my textbox name is : myTxt
and on the next page, which is my results page, i add a recordset like this...
SELECT *
FROM CategoryA
WHERE colOne like '%varOne%' and colTwo like '%varTwo%'
with the variables added ...
name: varOne | default value: -1 | run-time value: $_POST['myMenu']
name: varTwo | default value: -1 | run-time value: $_POST['myTxt']
I need to add another variable which represents the table of my database. which the value is get from the radio button selected by the user..
and Another Question is when i put 3 where conditions it gave me an sql error when i preview and run it in IE...
(e.g. select * from mytable where colOne like '%abc%' and colTwo like '%aaa' and colThree like '%xyz%' )
Please help me on the 2 problems...
Thanks!
I'm doing a Search function which consists of a category which i which to use radio buttons.
E.g. 4 Radio buttons.
Category A
Category B
Category C
Category D
and some other controls like a menu and a text box.. (which consists of the other criterias i need for the search...)
I was able to do the SQL on the menu. I retrieve the selected value in the menu and do a SQL to display the results.
But how could I get the radio button to do the same thing?
These radio buttons are actually tables in my database . (E.g Category A is a table in my database, Category B is another table....)
I did the SQL for the menu and the textbox like this...
my menu name is : myMenu
my textbox name is : myTxt
and on the next page, which is my results page, i add a recordset like this...
SELECT *
FROM CategoryA
WHERE colOne like '%varOne%' and colTwo like '%varTwo%'
with the variables added ...
name: varOne | default value: -1 | run-time value: $_POST['myMenu']
name: varTwo | default value: -1 | run-time value: $_POST['myTxt']
I need to add another variable which represents the table of my database. which the value is get from the radio button selected by the user..
and Another Question is when i put 3 where conditions it gave me an sql error when i preview and run it in IE...
(e.g. select * from mytable where colOne like '%abc%' and colTwo like '%aaa' and colThree like '%xyz%' )
Please help me on the 2 problems...
Thanks!
