Speficy more than one WHERE

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
SidewinderX
Forum Contributor
Posts: 407
Joined: Fri Jul 16, 2004 9:04 pm
Location: NY

Speficy more than one WHERE

Post 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'
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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...
Post Reply