/** * * @param type $user * @param type $pass * @return boolean |User */ public function getOneByDetails($user, $pass) { $query = "SELECT user_id,username,password FROM users WHERE username=? AND password=?"; $this->db->query($query, array($user, md5($pass))); $result = $this->db->row(); if (empty($result)) { return false; } return $this->getOneById($result['user_id']); }
public function deleteTodoItem($todo_id, $user_id) { $query = "DELETE FROM todos WHERE id=? AND user_id=?"; $params = array($todo_id, $user_id); $this->db->query($query, $params); $result = $this->db->row() > 0; if (!$result) { return FALSE; } return true; }