ideas on db and code creation

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
revocause
Forum Commoner
Posts: 94
Joined: Tue May 29, 2007 9:37 am

ideas on db and code creation

Post by revocause »

I'm creating a select menu where 2 of the <options> rely on on eachother to determine the overall.
Example:

option 1. = Select quantity (500, 1000, 1500, 2000, etc to 10000)

option 2. = Select paper type (80# gloss text, 80# matte text, 80# gloss cover, 100# gloss text, 100# matte text)

While this wouldve been simple to just call the individual price of the paper type, and multiply that by quantity, that isnt how it can go
(of course) lol.

In the real-world they want it so that if someone orders 500 , the price is more than say 10,000 pieces.
and so therein lies the issue.

Any suggestions on what the more seasoned php / mySql would do in this scenario?

I have a few ideas but it feels like chasing squirrels with one shoe on. (dunno why it feels like that , but thats what my thought told me)

So anyway , I'd like to set out in a good direction with confidence it will work.
Any suggestions?
thank ya's
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

You'd have it set up conditonally, either server-side or client side, to have the second option appear after the first has been selected, and have it correspond to the first selection. Server-side, you'd have them submit their first option and the second option would be based off of the posted value. Clientside, you'd have the second option be created once they've made a selection and changed accordingly.
Post Reply