Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //controller
- $username = $this->input->post("username", TRUE);
- $password = MD5($this->input->post('password', TRUE));
- //checking data via model
- $checking = $this->admin->check_login('tbl_users', array('username' => $username), array('password' => $password));
- //model
- function check_login($table, $field1, $field2)
- {
- $this->db->select('*');
- $this->db->from($table);
- $this->db->where($field1);
- $this->db->where($field2);
- $this->db->limit(1);
- $query = $this->db->get();
- if ($query->num_rows() == 0) {
- return FALSE;
- } else {
- return $query->result();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement