On Sun, 2006-05-28 at 18:49, Ryan A wrote: > Hi, > I have to write a kind of logging script which will > keep records of how long a person used the site and > its functions, so far this is what I have come up > with: > > login_username varchar(50) > as_guide <- You can ignore this,its for a special func > > login_time timestamp > logout_time timestamp > this_session_inlogged_time float > this_month timestamp > this_year timestamp > sum_total_time_inlogged varchar or float > > Any suggestions on changing any of the above, adding > fields or changing types? > I am not 100% sure of the timestamp type for most of > the fields. Presuming you know when they logged out or can calculate it: user_id login_time timestamp logout_time timestamp Your username values are probably nice and unique but a great big waste of space as a criteria by which to relate data. You should associate a unique integer value for each username. Regardless of how you determine the end of the logged in time, you shouldn't track all the different sums in every entry since that's redundant. You don't even need the extra data since the database will happily allow you to perform the SUMs via queries. Cheers, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php