halpernsiegel Posted November 3, 2008 Share Posted November 3, 2008 I am very new to php/mysql. I created a login form with username and password. When the user logs in the user name and datetime are successfully stored in a login table. However, it will only capture the information once. The user can successfully "login" more than once, but the information is only gathered once. I don't know how to make the table consider each login as an individual session. The code I am using is below: $sql="INSERT IGNORE INTO logintimes(user_name,datetime)VALUES('$_POST[fuser_name]', now())"; $result=mysqli_query($cxn,$sql) or die(mysqli_error($cxn)); $_SESSION['auth']="yes"; $_SESSION['logname'] = $_POST['fuser_name']; include("storedlog.inc"); I would appreciate it if anyone can tell me what is missing! Also, I would like to include an auto_incremented cust id field from the registration table that ties to the user name in the registration table to be input in the login table upon login. The cust id field exists in both the login and registration tables as the primary key, but I'm not sure of the code to use to connect them. Quote Link to comment https://forums.phpfreaks.com/topic/131261-login-table-does-not-store-information-more-than-once/ Share on other sites More sharing options...
revraz Posted November 3, 2008 Share Posted November 3, 2008 Hard to say without seeing when you do this in your code. Also, what attributes do you have on your user_name field in your table? Quote Link to comment https://forums.phpfreaks.com/topic/131261-login-table-does-not-store-information-more-than-once/#findComment-681483 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.