application/models/LoginModel.php
// Read data using username and password
Read data using username and password
Read data using username and password
public function Login($data) {
			$md_password = md5($data['password']);
			$email = $data['email'];
			$this->db->select('*');
			$this->db->from('formregistration');
			$this->db->where("(email = '$email')");
			$this->db->where('password', $md_password);
			$query = $this->db->get();
			if ($query->num_rows() == 1) {
			return $query->result();
			} else {
			return false;
			}
		}
public function Login ( $ data ) { $ md_password = md5 ( $ data [ 'password' ] ) ; $ email = $ data [ 'email' ] ; $ this -> db -> select ( '*' ) ; $ this -> db -> from ( 'formregistration' ) ; $ this -> db -> where ( " (email = ' $ email ') " ) ; $ this -> db -> where ( 'password' , $ md_password ) ; $ query = $ this -> db -> get ( ) ; if ( $ query -> num_rows ( ) == 1 ) { return $ query -> result ( ) ; } else { return false ; } }
Read data using username and password
Read data using username and password
//$condition = "user_name =" . "'" . $data['username'] . "' AND " . "user_password =" . "'" . $data['password'] . "'"; //$this->db->where('username', $data['username'] OR 'email' = $data['username']); //$this->db->limit(1);