How to combine WHERE and BETWEEN

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
Peter Kelly
Forum Contributor
Posts: 143
Joined: Fri Jan 14, 2011 5:33 pm
Location: England
Contact:

How to combine WHERE and BETWEEN

Post by Peter Kelly »

I'm currently making an APi system on my website. I need to choose from the api_requests table where

app_id = "3" and time between 2705100700 and 2705101000.

I can do both seperately but I dunno how I can combine that in one query.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: How to combine WHERE and BETWEEN

Post by pickle »

what you've got there is perfectly fine. The "AND" after the app_id clause is considered a boolean comparitor, but the AND between your two time values is not.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply