0

You must use the "set" method to update an entry.次の方法を使用するとエラーが発生する理由を理解しようとしています。これを行うために、Jamie Rumbelow の MY_Model を使用しています。

$this->failed_login->insert_login_attempt($this->input->ip_address(), 
                                $post_username,
                                gmdate('Y-m-d H:i:s', time())); 

public function insert_login_attempt($user_ip_address, $username, 
                                $datetime_of_attempt)
{

    $failed_attempt = array(
        'user_ip_address' => $user_ip_address,
        'username' => $username,
        'datetime');
    $this->db->insert($failed_attempt);

}
4

1 に答える 1

3

$this->db->insertテーブルを挿入するテーブルを知る必要があります。テーブルを指定しない場合、データをどこに置くかをどのように知るのでしょうか? :-P

$failed_attempt = array(
    'user_ip_address' => $user_ip_address,
    'username' => $username,
    'datetime' => $datetime_of_attempt);

$this->db->insert('YOUR_TABLE', $failed_attempt);

編集jamierumbelow'sMY_Modelを使用しているため、ドキュメントに従う必要があります。

$failed_attempt = array(
    'user_ip_address' => $user_ip_address,
    'username' => $username,
    'datetime' => $datetime_of_attempt);

$this->insert($failed_attempt);
// OR $this->failed_login->insert($failed_attempt);
于 2013-07-31T16:43:56.747 に答える