0

(when selecting data from tables in MYSQL database) something like this:

WHERE some_column = some_value, other_column = other_value

If not, Is there other simple method rather than going into "if loops"

2
  • What's wrong with using WHERE some_column=some_value AND other_column=other_value? Or am I missing something? Commented Oct 6, 2011 at 16:26
  • 1
    if is not a loop and there is nothing wrong in them anyway. most of time you have to use if statements to create a dynamical mysql query. Commented Oct 6, 2011 at 16:31

2 Answers 2

7

Yes, just separate them with ANDs:

WHERE some_column=some_value AND other_column=other_value
Sign up to request clarification or add additional context in comments.

1 Comment

You can also use OR depending on the logical result you are trying to achieve.
3
WHERE some_column = some_value AND other_column = other_value

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.