Jump to content

selecting age from a range


lukkyjay

Recommended Posts

i take it you will have 5 or 6 prices in the table base don age range?

 

item    price    ageRange

chair    10.50    30-35

chair    9.50      35-40  etc???

 

if so you can have an ageRange column which can just be a number (if there are ten age ranges then a number up to 10) and then the select statment would be

 

$query="SELECT chairPrice FROM table WHERE ageRange = 3" //if the third age range = 35-40

 

hope that makes sense

 

I have the database setup.  It has multiple products with multiple features that have different prices based on age and gender.  A single person, husband/wife, or family can get quotes and the prices are just added together.  i.e.... product A in blue is $X for a single person but product A in blue is $XY for a husband and wife or $XYZ for a husband wife and child.  I'm trying to figure out what would be the best way to sum (if needed) multiple results into a repeat region and have the price field show the value for either the single person getting quotes, the person + spouse, or the person + spouse + kid(s), and so on with different possible combinations.

 

I would be very thankful if somebody can point me in the right direction with a function name or a process I should be thinking about.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.