a suggestion to configure a script

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hello from Italy!

I'm going to create a php script that registers and reports stats for
20/30 externals sites (with about 2.000 daily visitors each one).

I need to configure the tables (mysql) where I would store visitors data.

I need help to choose between these solutions:

a) two table visitors and visits whit a field site_id to distinguish
between monitorated sites visitors

b) two table for each site: site_1_visitors, site_1_visits,
site_2_visitors, site_2_visits etc...

What do you think about it?


Re: a suggestion to configure a script

Quoted text here. Click to load it

This is a database question, which you should ask in database groups...

However: most flexible is a) (with offcourse an extra table 'sites'). Easy  
to add & drop sites, and with the proper indexes it should be about as  
quick. Duplication of similar tables like in b) is almost never a viable  
Rik Wasmus

Re: a suggestion to configure a script

Rik Wasmus wrote:
Quoted text here. Click to load it

As a database professional - I would concur.  b) gets to be very messy
when trying to manage as in the fact that you must always modify your
code AND your database every time you add/drop a site. Option a) is a
lot more manageable.

Site Timeline