Create username, password and lastlog for mysql database. Please advice how I can add the last login DATE everytime when the user login with the username and password?
I tried inserting the date by doing the following but it did not insert the date into the same column as the username with password. Instead it simply adds into a new line without the username and password. How do I make it inserts into the existing user that login?
Please advice. Thanks!
PHP Code:
require_once("connect.php");
$username = $_POST['username'];
$password = $_POST['password'];
$search_user_query = "SELECT * FROM " . TABLE_NAME . " WHERE `" . USER_NAME . "`='$username' AND `" . PASS_NAME . "`='$password'";
$search_user_result = @mysql_query($search_user_query);
$query = mysql_query("insert into TABLE_NAME set date=CURDATE()");