Код: Выделить всё
SELECT *
FROM mb_login_attempts
WHERE ip_adress_hash = ?
AND DATE_ADD(attempt_date,INTERVAL 30 MINUTE) > NOW()
Код: Выделить всё
$this->db->where('ip_adress_hash', $this->encrypt->sha1($this->input->ip_address()));
$this->db->where('DATE_ADD(attempt_date,INTERVAL 30 MINUTE) >', 'NOW()', TRUE);
if ($this->db->count_all_results('mb_login_attempts') >= 3) {
return true;
}
Код: Выделить всё
$sql = "SELECT *
FROM mb_login_attempts
WHERE ip_adress_hash = ?
AND DATE_ADD(attempt_date,INTERVAL 30 MINUTE) > NOW()";
$val = $this->db->query(
$sql,
$this->encrypt->sha1($this->input->ip_address())
);
if ($val->num_rows() >= 3) {
return true;
}
Подробнее здесь: https://stackoverflow.com/questions/108 ... 30-minutes
Мобильная версия