•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 456,234 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,754 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums
Views: 734 | Replies: 5
![]() |
•
•
Join Date: Nov 2007
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
Hi All,
Newbie poster here.
I have an, I guess, architectural question. I am still very much a beginner in mysql so bear with me.
I have an e commerce site in which the prices of my products fluctuate very often. By default, my customers see the regular prices or sale prices for each product. The exception is when a returning customer comes to my site, I need them to see the prices they paid last time they made a purchase.
Ex: Customer A bought 3 widgets last month at $5.00 a widget. The price now is $6.00 a widget but when customer A logs in they see the price they paid last time which is the $5.00 per widget.
Finally my question.
Can anybody recommend the best way to do this in terms of database structure?
For example should I keep a separate table linked to the customer table that holds an array of each item they have purchased in the past and the price they paid?
Is there a better way to do it that anybody can think of?
Thanks all
- Bill
Newbie poster here.
I have an, I guess, architectural question. I am still very much a beginner in mysql so bear with me.
I have an e commerce site in which the prices of my products fluctuate very often. By default, my customers see the regular prices or sale prices for each product. The exception is when a returning customer comes to my site, I need them to see the prices they paid last time they made a purchase.
Ex: Customer A bought 3 widgets last month at $5.00 a widget. The price now is $6.00 a widget but when customer A logs in they see the price they paid last time which is the $5.00 per widget.
Finally my question.
Can anybody recommend the best way to do this in terms of database structure?
For example should I keep a separate table linked to the customer table that holds an array of each item they have purchased in the past and the price they paid?
Is there a better way to do it that anybody can think of?
Thanks all
- Bill
•
•
Join Date: Nov 2007
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
•
•
•
•
store those details on another table with cust id n product id n store that price there.
There are two problems with that (probably should have mentioned this)
- We are talking about 50,000 customers.
- There are over 5000 products.
If I created another table with that information it would get very large very quickly.
My idea was since each customer probably has 20 - 30 custom prices I could store those values in some delimited format in another table and link it to the customer id in the customer table. Then when the user logs in, the delimited values are broken apart and stored in an array.
It just sounds like a hack of a way to do something like this so I was wondering if anybody knew a better way.
Thanks !!
![]() |
•
•
•
•
•
•
•
•
DaniWeb MySQL Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Democracy or Dictatorship? (Geeks' Lounge)
- Theoretical question: poly root finding (secant method) (Computer Science and Software Design)
- IDENTITY question (MS SQL)
- OOP's and GUI's...oh my! (Computer Science and Software Design)
- Changing Network Configuration (*nix Software)
Other Threads in the MySQL Forum
- Previous Thread: selecting the day from the DATE field so that it includes a zero...
- Next Thread: syntax error....


Linear Mode