Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select records in a range of values

Status
Not open for further replies.
Jul 28, 2005
358
FR
Hi,

Not too sure how to do this but am certain that it should be easy.

I have a figure that a user inputs into a php script for how many people an apartment sleeps. What I want to do is select all properties in a database where this is so. Ok, easy enough for now. What I also need to do is to select apartments that may sleep 1 or 2 people more as well.

So, for example, if a person asks for apartments that sleep 3 people, it should return all apertments that sleep 3 and 4 people (already got this working), but if the person asks for an aprtment that sleeps 6 people, it should give all apartments that sleep 6,7 and 8 people and if they ask for an apartment that sleeps 10 people then it should return all apartments that have more than 10 in teh sleeps field.

Any ideas on how to do this?

Thanks,

Richard
 
Don't worry,

I knew it must be really easy. Of course, I should use between for the range one and >= for the more than.

I think I need some sleep!!

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top