Page 1 of 1

Speficy more than one WHERE

Posted: Fri Nov 17, 2006 6:12 pm
by SidewinderX
well i have a mysql query

Code: Select all

$result1 = sql_query("SELECT topic_id, topic_last_post_id, topic_title FROM forum_topics WHERE forum_id='22' LIMIT $amount", $dbi);
i want to know if/how i can select stuff from say forum_id='22' and forum_id='23'

Posted: Fri Nov 17, 2006 6:13 pm
by volka
WHERE forum_id=22 OR forum_id=23
WHERE forum_id>21 AND forum_id<24
WHERE forum_id IN (22,23)
WHERE forum_id BETWEEN 22 AND 23

make your choice...