Forum Moderators: coopster

Message Too Old, No Replies

Multiple databases item counter

How to reduce hard coding and slow server

         

tomda

7:57 am on Feb 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

I have 25 shops and each shop is having between 80 to 125 items (items are identical but some shops may not sell all items).

I have a Shop database : shop1, shop2, etc...
I have a Item database : item1, item2, etc...

Now, I need how many times each item was sold per shop.

Any idea on how I should proceed. I though the fastest would be to use .dat file (open, update) and not using databases.

Thanks

Tommy

dcrombie

1:06 pm on Feb 10, 2004 (gmt 0)



File access is generally slower than database access. I would create a new table (orders) with (shopid, itemid, timestamp). Then you can work out totals using COUNT.

tomda

1:25 pm on Feb 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks Dcrombie,
Nice advice, this will help.
Tommy

incywincy

1:30 pm on Feb 10, 2004 (gmt 0)

10+ Year Member



i would definitely stick with a database. as suggested create new tables for each site or insert a column in your existing table to hold a "site_id".

this centralises your data and makes reports generation easier.