Select from MySQL DB using OR Parameter [Possible?]

Hopefully this makes sense… I have written a script that checks to see if a visitor has a cookie from the website. If not, on every page that loads, one of those dynamic pop overs pops up and asked for the email address and zip code. Once the person submits it, it adds the cookie, and the person can view the site without the popup popping up. Now, on my end, I have a form that I can search all zips within a certain mile radius from a specific zip code and I store in variable “$zips”. I know the script functions properly, because when I echo “$zips” I get all the zip codes.

Now, what I want to do is run a query that selects all emails from the database where the zip code equals any of the zips in the “$zips” string. Is this possible?

If I understand your task correctly, the query will look like this:

SELECT email FROM users WHERE Zip in ('10001','10002','10003')
Sponsor our Newsletter | Privacy Policy | Terms of Service