Jump to content

Archived

This topic is now archived and is closed to further replies.

xenooreo

Multiple WHERE's?

Recommended Posts

Hey, is it possible to somehow use multiple WHERE's in a SELECT query?
I'm working on a photoshop site, and I need the results to be something like WHERE `category` = 'tutorial' and WHERE `isFeaturedContent` = '1'
However, I'm having difficulty getting it to do both :P

Thanks for your help in advance!

Share this post


Link to post
Share on other sites
[!--quoteo(post=384291:date=Jun 15 2006, 01:33 PM:name=xenooreo)--][div class=\'quotetop\']QUOTE(xenooreo @ Jun 15 2006, 01:33 PM) [snapback]384291[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Hey, is it possible to somehow use multiple WHERE's in a SELECT query?
I'm working on a photoshop site, and I need the results to be something like WHERE `category` = 'tutorial' and WHERE `isFeaturedContent` = '1'
However, I'm having difficulty getting it to do both :P

Thanks for your help in advance!
[/quote]

SELECT whatever_columns FROM whatever_table WHERE category='tutorial' AND isFeaturedContent=1

Take a look at some of the examples in the MySQL manual for the simpler stuff. I think there's a tutorial there.

Share this post


Link to post
Share on other sites
Thanks, works great.

Just wasn't quite sure how I would connect 2 of them. [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.