Search Query Problem with MySQL and DWMX
Posted: Fri Aug 08, 2003 4:22 pm
This is my query that I'm having problems with
My variables are:
Problem
When I do the search it only works when I have information in both variables or in searchGender only. If I have information only in searchLast my find search returns no records. See the query example below when I had the variable $query_rsLD to display it's content.
Notice how laos.gender = '', I think it should read laos.gender = '%%' but it's not.
What's wrong here?
-Dave
Code: Select all
SELECT laos.`last`, laos.`first`, laos.gender
FROM laos
WHERE laos.gender = 'xGender' AND laos.`last` LIKE 'xLast%'
ORDER BY laos.`last`Code: Select all
xGender with a default value of 1 and a runtime value of $HTTP_GET_VARSї'searchGender']
xLast with a default value of 1 and a runtime value of $HTTP_GET_VARSї'searchLast']When I do the search it only works when I have information in both variables or in searchGender only. If I have information only in searchLast my find search returns no records. See the query example below when I had the variable $query_rsLD to display it's content.
Code: Select all
SELECT laos.`last`, laos.`first`, laos.gender FROM laos WHERE laos.gender = '' AND laos.`last` LIKE 'mccowan%' ORDER BY laos.`last`What's wrong here?
-Dave