Re: Advice On Building Dynamic MySQL Queries
| From: | Victor Foitzik | Date: | Fri, 20 Apr 2001 01:38:35 +0000 |
| Subject: | Re: Advice On Building Dynamic MySQL Queries | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-8738@lists.php.net to get a copy of this message | ||
Hello JD,
on 19.04.2001 you wrote:
> if (!empty($Price))
> {
> if(empty($whereclause))
> {
> $whereclause.="Price$Price";
> }
> else
> {
> $whereclause.=" AND 'Price $Price";
> }
> }
and even better would be:
if (!empty($$varname)) {
$whereclause .= ($whereclause ? ' AND ' : '').
"$varname =" . $$varname;
}
or something like this ;-)
HTH
Vic