0

Hi
I have a table which I am trying to pull some data out of. I am trying to select all the data where one field matches two numbers.

mysql_query ("SELECT articles.*,articles_comments.*
                                FROM articles LEFT JOIN articles_comments
                                ON articles.id= articles_comments.articleid
                                WHERE articles.cat_id='$cat_id'
                                AND articles.status='1');

what I want to do is select all the articles which status is 1 or 12.

is that possible

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by khr2003
0

Use parenthesis for grouping just like math

SELECT * FROM sometable WHERE somefield = 1 AND (anotherfield = 1 OR anotherfield = 12)
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.