Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Using Radio Button for Search

New Here ,
Sep 28, 2006 Sep 28, 2006
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!

TOPICS
Server side applications
210
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 28, 2006 Sep 28, 2006
Please Read the above message before reading this.

Regarding the above situation of writing a sql with 3 conditions.
this is the error IE showed when i use 3 where conditions.

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'like '%%') LIMIT 0, 20' at line 1
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 01, 2006 Oct 01, 2006
LATEST
Anyone could kindly help me?
Read the above 2 posts and give me some help.
Thanks.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines