Forum Moderators: open
As you can probably see I just joined after finding myself ending up here one way or another on a lot of issues. Wonderful site I must say, keep it up!
Anyway, my last project started up a few weeks ago and is very small-scale price-comparison-like site. Since i'm completely new to Php (although I have quite some experience of a lot of programming, from VB and C(++) to ASP and Java and JavaScript) it took me a while to read up and try out, but now I got most things sorted. Anyway: back to the database:
I started to scratch my head hard for a few days and finally came up with this, afaic normalised, structure (only relevant items showed):
TBL: Categories [~10 rows]
id, name
TBL: Sub-categories [~20-50 rows]
id, cat-id, name
TBL: Items [~200-500 rows]
id, sub-cat-id, name
TBL: Stores [~50-100 stores]
id, name
TBL: Prices_[date] [max count(item_rows) rows]
item-id, store_[store-id]_price
(Side note: my first approach of fetching data was to use nested loops (get cat, get s_cat where cat-id=id and so on) but realised it resulted in quite a massive amount of db querys. i switched into getting all rows and storing them in arrays instead and displaying from there. Made execution time about 1/6 of what it used to be! ;) )
Anyway. Everything was find until yesterday I realised I was probably trying to reinvent the wheel... I realised I was kind of building an ultra-smallscale cvs! I tried searching for cvs database design but found only complete cvs systems and manuals for them...
Well, my main problem (as I see it), maybe apart from performance issues I am not aware of, is when I want to display price development from say 50 price readings. That would mean getting info about one item_id from 50 diffent tables! Although this would be a pretty rarely used function, it still seems like a waste, but I cant think of any good solution/approach.
What do you say guys? Can you point me in the right direction?
Any help would be greatly appreciated! Please also say if you think my approach is rubbish, I really need some opinions here!
Regards
SweVictor
P.S. Sorry for the long post, but I really got caught in the middle of it! ;)