Link to home
Start Free TrialLog in
Avatar of ipconfig610
ipconfig610Flag for United States of America

asked on

I need some PHP code that will READ a value in a MySQL database and UPDATE value by 1

I have a very simple web users database which a MySQL database called "users".  In the users database there is a table called "members" which stores usernames and passwords.  I added a new Field called "logins" so we could track the total number of logins by each user.

I need some PHP code that will increment the "logins" field each time a web user logins in.   Currently i have a checklogin.php file that registers the users session upon successful login.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Lukasz Chmielewski
Lukasz Chmielewski
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bluedevil9
bluedevil9

once the session is active, pull the "logins" value from the database of the particular user and increment the value and update the value using the update query.