Jump to content


Photo

Multiple WHERE's?


  • Please log in to reply
2 replies to this topic

#1 xenooreo

xenooreo
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 15 June 2006 - 05:33 PM

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!

#2 Wildbug

Wildbug
  • Members
  • PipPipPip
  • Advanced Member
  • 1,149 posts

Posted 15 June 2006 - 06:02 PM

[!--quoteo(post=384291:date=Jun 15 2006, 01:33 PM:name=xenooreo)--][div class=\'quotetop\']QUOTE(xenooreo @ Jun 15 2006, 01:33 PM) View Post[/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.
Twice a day my clock works PERFECTLY!  I can't figure out what's wrong with it.

#3 xenooreo

xenooreo
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 15 June 2006 - 07:25 PM

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\" /]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users