
June 10th, 2004, 05:34 AM
|
|
Contributing User
|
|
Join Date: Sep 2003
Location: Western Australia
Posts: 36
Time spent in forums: 2 h 18 m 6 sec
Reputation Power: 5
|
|
|
Simple SQL statement with checkboxes
Hi,
Just need a little help with a simple SQL statement.
I have a database which includes a field entitled 'DOC_TYPE'. There are currently four different document types stored under this field.
I have a search form which allows users to search on one particular document type by entering a keyword into a textfield - so they get all the document types which include that keyword in another field.
ie
SELECT * FROM myTable WHERE 'DOC_TYPE' = 'type01' AND ((field1 LIKE 'myVariable') OR (field2 LIKE 'myVariable) etc
With this method I would have to have four different search forms to allow users to search on the four different document types.
Obviously the better way to do it would be to have 4 checkboxes, one for each document type, accompanied by a texfield in which the user enters a keyword to filter the document types.
The problem is, I have no idea how to incorporate 4 checkboxes in this statement.
Can anyone help.
Many thanks,
mM
|