Printing out when the user last logged in
Posted: Mon Nov 24, 2003 11:31 am
Hey
I am having some trouble printing out when the user last logged in
I am trying to extract the date from the database and then update the lastlogin with the current date in the database! When I try to print the the date nothing is printed! I would love any help at all!
Thanks
Sorry here is the code!
//Set date
$date = date("d-m-y");
$result1= mysql_query(" SELECT Lastlogin FROM Users WHERE username='$username'") or die ("couldn't execute query.");
while ($row = mysql_fetch_array($result1)) {
echo "You last logged in on the ";
echo $Row[0];
echo "Todays date is ";
echo $date;
}
//Update the lastlogin in the database with todays date
$update_login = ("UPDATE Users SET Lastlogin = '$date' WHERE username = '$username'");
I am having some trouble printing out when the user last logged in
I am trying to extract the date from the database and then update the lastlogin with the current date in the database! When I try to print the the date nothing is printed! I would love any help at all!
Thanks
Sorry here is the code!
//Set date
$date = date("d-m-y");
$result1= mysql_query(" SELECT Lastlogin FROM Users WHERE username='$username'") or die ("couldn't execute query.");
while ($row = mysql_fetch_array($result1)) {
echo "You last logged in on the ";
echo $Row[0];
echo "Todays date is ";
echo $date;
}
//Update the lastlogin in the database with todays date
$update_login = ("UPDATE Users SET Lastlogin = '$date' WHERE username = '$username'");