Re: DB_DataObjects and generating search filters

From: Date: Thu, 21 Apr 2005 02:33:21 +0000
Subject: Re: DB_DataObjects and generating search filters
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-18846@lists.php.net to get a copy of this message
Are you asking if you would need to check if each post field is set? I wouldn't think so. If you wrapped something a bit like the code I provided in a loop (for each element of $_POST) then I think it would work the way you expected. Even if a a given $_POST variable was empty, then it would end up producing the SQL "field_name LIKE '%%'", which means, 'like anything'. If you didn't want that (it is a waste of processing after all), then you just put a simple if statement inside your loop. I don't see any problem with using this in general code. On Thu, 21 Apr 2005 12:02 pm, pear@electroteque.org wrote: > Thanks craig, but this would mean i would need to check if fields are set > and moves away frombeing generated from post to static setups :| -- Craig Ambrose Web Elements http://www.portallus.com/people/craigambrose/

« previous php.pear.general (#18846) next »