--- Sebastian Mendel <[EMAIL PROTECTED]> wrote:
>
> $where = array();
>
> if ( isset($_POST['Ind']) ) {
> $where[] = 'vendorjobs.Industry = ' . (int)
> $_POST['Ind'];
> }
> if ( isset($_POST['Days']) ) {
> $where[] = 'Date_Sub(Curdate(), interval ' .
> (int) $_POST['Days'] .
> ' day) <= PostStart';
> }
>
> $sql = '
> SELECT ...
> FROM vendorjobs
> WHERE ' . implode( ' AND ', $where );
>
Sebastian, I meant to thank you for this code the
other day.
What I'm trying to figure out is some of my elements
are arrays themselves. So for example I have this :
$Ind = "";
$Ind = $HTTP_POST_VARS['Ind'];
if (count($Ind) > 0 AND is_array($Ind)) {
$Ind = "'".implode("','", $Ind)."'";
}
So how would this code , or array get into what you
stated as:
> $where = array();
>
> if ( isset($_POST['Ind']) ) {
> $where[] = 'vendorjobs.Industry = ' . (int)
> $_POST['Ind'];
> }
I guess that is putting an array into an array ?
Not quite sure how the loop would go.
Thank you,
Stuart
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php