gpt4 book ai didi

php - 意外的 T_STRING,期待 T_FUNCTION

转载 作者:行者123 更新时间:2023-12-01 00:13:35 25 4
gpt4 key购买 nike

<分区>

刚刚学习如何使用 PHP 和 MySQL,使用 CodeIgniter。遇到那个错误。

我试图根据我的数据库检查登录尝试,它们存储在那里。以下是我的登录模型中的相关函数:

public function verify_user($email, $password)
{
$q = $this
->db
->where('email_address', $email)
->where('password', $password)
->limit(1)
->get('users');

if ($q->num_rows > 0)
return $q->row();
}
add_login_attempt($email);
return false;
}

public function add_login_attempt($email)
{
$current_attempts = get_login_attempts($email);

if ($current_attempts > 2)
{
lock_account($email);
}
else
{
$updated_attempts = $current_attempts + 1;
$data = array('login_attempts' => $updated_attempts);
$this->db->where('email_address', $email);
$this->db->update('crm', $data);
}

}

function reset_login_attempts($email)
{

}

function lock_account($email)
{

}

public function get_login_attempts($email)
{
$this->db->select('login_attempts');
$this->db->from('crm');
$this->db->where('email_address', $email);
$login_attempts = $this->db->get();

return $login_attempts;
}
}

使用正确的凭据登录没有问题。输入不正确的密码时,会遇到该错误。非常感谢任何帮助。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com