On Wednesday 10 November 2004 14:37, Stuart Felenstein wrote:

> But if the user decides to only use one of the
> elements, then I don't want the query to return
> nothing because of the "And" in the where clause so I
> have these 2 statements that set a default value
> (shown here as 0 in the event one of the two elements
> aren't selected:  (Having no luck as the form still
> only works correctly if I've set both elements)

Why not build your sql query according to whether or not whatever you want is 
selected or not.  That way debugging is easier as you won't be looking at 
queries that contain redundant "... AND 0 ...".

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
This system will self-destruct in five minutes.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to