Thanks for the time John.

Chris's did the trick. I'll keep yours on hand in case I do happen to
run into problems.

I DO appreciate your help.

Thanks again!

Aaron

> -----Original Message-----
> From: John W. Holmes [mailto:[EMAIL PROTECTED]
> Sent: March 19, 2004 11:28 AM
> To: Aaron Wolski; [EMAIL PROTECTED]
> Subject: Re: [PHP] confused about logic
> 
> From: "Aaron Wolski" <[EMAIL PROTECTED]>
> 
> > I have input for where users can enter order numbers in which to
search
> > the database to find results matching their entry.
> >
> > To enter multiple order numbers they can comma separate like:
> > 1,34,21,34,54
> >
> > What I need to do is take those numbers and make a query that would
like
> > like:
> >
> > (cart_id in('1','34','21','34','54') OR id
in('1','34','21','34','54'))
> 
> Why do you need to put quotes around integers??
> 
> $var = '1,34,21,34,54';
> 
> //replace comma with quote,comma,quote and add quotes to beginning and
end
> $in_clause = "'" . str_replace(',',"','",$var) . "'";
> 
> $query = "WHERE (cart_id IN ($in_clause) OR id IN ($in_clause))";
> 
> ---John Holmes...
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

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

Reply via email to