Price range coding

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
slomotion
Forum Newbie
Posts: 13
Joined: Fri Jun 22, 2007 9:15 pm

Price range coding

Post by slomotion »

I tried to search for different things in mysql and php but couldnt find anything

I am trying to list a price range for products

example: $XXX - $XXX

pulling it from a list in mysql. I was wondering if anyone had any idea of where to get some ideas?

Thanks ahead of time.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You're probably looking for the BETWEEN construct.

http://dev.mysql.com/doc/refman/5.1/en/ ... on_between
slomotion
Forum Newbie
Posts: 13
Joined: Fri Jun 22, 2007 9:15 pm

Post by slomotion »

close but I guess i didnt explain myself good enough. I am looking to list the lowest price possible right next to the highest possible price. I haven't been able to think of any way to do that.

Im having difficulty getting each of the two values and displaying them.

//Yes I am a newbie
slomotion
Forum Newbie
Posts: 13
Joined: Fri Jun 22, 2007 9:15 pm

Post by slomotion »

I figured it out, I feel like an idiot now that I couldnt figure it out
Post Reply