Jump to content

Query Help


Kelset

Recommended Posts

Hello All!

I hate to be bugging you folks but I have a newbie question that I can not seem to figure out.
I have a DB with fields (name,dis,S,F,W,state) the S,W,F are set to enum ('true','false'). Ok now
the query I need to run on this is what has me going insane.

I would like to query where the dis equals someting and the state equals and the F or W or S egual
somthing. I know I am not explaining this very well and for that I am sorry.

Here is as far as I can make it :(

$query = "SELECT * FROM tableName WHERE dis='value' and state='value'"

the above is simple and works great but I get the values for S,W,F from an array
so there might be a S and a W. So I would like to see all the jobs that have dis='value'
and state='vale' and have either a S or a W='true'

Maybe I'm just dreaming of the impossiable, sure hope not :(

Any help would be great and thank you for you time in helping me

Stephen
Link to comment
Share on other sites

This seems to do the trick thank you so much. I was wondering how I was going to do this and
even tried your code but with out the brackets (doh!). Again thanks for the help, if you have time
maybe explain it to me.

Cheers!
Stephen
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.