0
我有以下的類來驗證用戶登錄,笨NUM_ROWS()總是返回0
class Validation_model extends CI_Model {
public function validateLogin($userid,$userpass){
$this->load->library('encrypt');
$this->load->database();
$encrypted_string = $this->encrypt->encode($userpass);
$this->db->select('*');
$this->db->from('ecom-user');
$this->db->where('userid', $userid);
$this->db->where('userpassword', $encrypted_string);
$result = $this->db->get();
echo $result->num_rows();
}
}
但當連我進入了一個有效的用戶ID &密碼,它返回的行數爲0,請幫我解決這個問題,我犯了什麼錯誤?
打印最後一次查詢,並在您的phpmyadmin運行 –
它也返回零:( –
大概$ encrypted_string不工作...嘗試在查詢中手動輸入密碼,看看它是否在 – Makrand