DATETIME
当用户登录他们的帐户时,我正在尝试将电流插入 MySQL。屏幕上未显示错误,登录但 NOW() 未插入。我已经检查了 MySQL 中的列声明并且它是正确的——DATETIME
我的PHP在下面
if(isset($_POST['username']) && isset($_POST['password'] )) {
$query = mysql_query("SELECT username, password, image_name
FROM forum_login
WHERE username = '$username'
AND password = '$password'") or die (mysql_error());
$user = mysql_num_rows($query);
if($user == 1) {
$row = mysql_fetch_assoc($query);
$_SESSION['username'] = $row['username'] ;
$_SESSION['image_name'] = $row['image_name'] ;
$login_time = mysql_query("UPDATE forum_login
SET last_login = 'NOW()'
WHERE username = '".$_SESSION['username']."'") or die (mysql_error());
header('Location: http://127.0.0.1/tapmichiana/');
die;
}
else
{
echo "<div class='OpenError' >";
echo "Username & Password Combination Is Wrong";
echo "</div>";
}
我没有显示用于数据清理和清理的部分脚本