Forum Moderators: coopster

Message Too Old, No Replies

mysql query multiple conditions.

         

duckxtales

11:00 pm on Jan 31, 2007 (gmt 0)

10+ Year Member



Hi i want to do a mysql select with more than 1 conditions.

I have this:

select * from phpbb_posts where post_time = 1064078039;

but i want to be able to select multiple post_time's. I'm guessing it was something like this:

select * from phpbb_posts where post_time = (1064078039, 1034078039, 10640744039, 10643378039, 1064076039);

but thats obviously wrong. Anyone can help here?

thx...

coopster

11:11 pm on Jan 31, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



select * from phpbb_posts where post_time IN (1064078039, 1034078039, 10640744039, 10643378039, 1064076039);

You might also want to look into the BETWEEN operator too. Might not work in this case, but comes in handy quite often!

cameraman

11:12 pm on Jan 31, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



post_time IN (1064078039, 103

MAN you gotta be fast around here!