RE: [PHP] Dynamic Queries
| From: | Samantha Savvakis | Date: | Tue, 28 Nov 2000 01:00:26 +0000 |
| Subject: | RE: [PHP] Dynamic Queries | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-27529@lists.php.net to get a copy of this message | ||
> if ( isset($Where) ) {
> $str_sql .= " WHERE ";
> $str_sql .= implode(" AND", $Where);
> }
One quick mention about doing : implode(" AND", $Where)
You don't always "AND" all the where statements together.
eg.
WHERE ((col1 = col2) AND (col3 = col4))
OR ((col1 = col3) AND (col2 = col4))
It's not always "AND". Just keep that in mind when designing query.