PDA

View Full Version : PHP Login Count



Pyroka
08-01-2009, 04:37 PM
Hi,

I need some help with a user system I'm making. Basically, I need to code in PHP, a way of recording the amount of times a user has logged into the system (NOT how many users are logged into the system). It wouldn't be a overall statistic, it'd just be for individual users.

I was thinking of creating a table in my database, but then I'm clueless on how I'd be able to do everything after that LOL. Any help would be appreciated greatly. :]

Invent
08-01-2009, 10:49 PM
Hey Ryan,

In your user store table, add a new column called something like 'login_amm' and then on each login, run a query like this;



UPDATE `user_store` SET `login_amm` = ( `login_amm` + 1 ) WHERE `userid_column` = '<user_id_value>'
.

Hope this helps...

Pyroka
08-01-2009, 11:07 PM
Cheers Simon, I've had 2 people PM me on this so it's another method to try out :D

It was Jack120 and Calon by the way, which helped me out... You should recruit them into your coding community nizzle.

Want to hide these adverts? Register an account for free!