Hi,
I'm pretty new to php but I can't find example code for this anywhere - basically, i need a big textbox where I can paste in a bunch of product ID's, hit submit, and query the database for all the product ID's i just entered. The result set might include product ID and name for example.
I know how to do this with a little one-line textbox for a single product ID, but how should i go about querying a bunch of product IDs at the same time?
query a bunch of values at the same time
Moderator: General Moderators
-
catstevens
- Forum Newbie
- Posts: 3
- Joined: Fri Jul 06, 2007 5:30 pm
- stereofrog
- Forum Contributor
- Posts: 386
- Joined: Mon Dec 04, 2006 6:10 am
hi there
use sql IN operator:
use sql IN operator:
Code: Select all
select whatever from products where id IN (1, 2, 500, 1239)-
catstevens
- Forum Newbie
- Posts: 3
- Joined: Fri Jul 06, 2007 5:30 pm
-
catstevens
- Forum Newbie
- Posts: 3
- Joined: Fri Jul 06, 2007 5:30 pm