Код: Выделить всё
public function validate()
{
$username = $this->security->xss_clean($this->input->post('username'));
$password = $this->security->xss_clean($this->input->post('password1'));
$type = $this->security->xss_clean($this->input->post('utype'));
$password = md5($password);
$this->db->select('*');
$this->db->from('ci_users');
$this->db->where('email', $username);
$this->db->where('password', $password);
$this->db->where('utype', $type);
// Run the query
$query = $this->db->get();
// Let's check if there are any results
if($query->num_rows == 1)
{
// more scripting
} else {
echo "OOPS some error";
}
}
Подробнее здесь: https://stackoverflow.com/questions/410 ... essing-num
Мобильная версия