Error unknown column 'user' in 'where clause' code igniter

Gan Kira kira error kenapa ya padahal di database ada table user dan kolom email tapi ttp error kenapa ya ini SC nya : Ini error nya :

A Database Error Occurred
Error Number: 1054

Unknown column 'user' in 'where clause'

SELECT * FROM `user` WHERE `user` = 'salam@gmail.comda' LIMIT 1

Filename: D:/xampp2/htdocs/Client/system/database/DB_driver.php

Line Number: 691

 private function _login()
    {
        $email = htmlspecialchars($this->input->post('email', true));
        $password = $this->input->post('password', true);

        $user = $this->db->get_where('user', ['email' => $email])->row_array();
        //apabila user aktif
        if ($user) {
            if ($user['is_active'] == 1) {
                //cek password
                if (password_verify($password, $user['password'])) {
                    $data = [
                        'email' => $user['email'],
                        'role_id' => $user['role_id']
                    ];
                    $this->session->set_userdata($data);
                    if ($user['role_id'] == 1) {
                        redirect('admin');
                    } else {
                        redirect('customer_service');
                    }
                } else {
                    $this->session->set_flashdata('message', '<div class="alert alert-danger" role="alert">
                         Password Salah
                        </div>');
                    redirect('auth');
                }
            } else {
                $this->session->set_flashdata('message', '<div class="alert alert-danger" role="alert">
                    Email Belum Terdaftar!
                        </div>');
                redirect('auth');
            }
        }
    }

avatar jiasfjabfie1212
@jiasfjabfie1212

38 Kontribusi 0 Poin

Diperbarui 2 tahun yang lalu

Tanggapan

cek kolom user nya tulisan nya udah bener blm user, bkn users

2 Jawaban:

Jawaban Terpilih

karena di where clause nya yg kamu cek itu column user <pre> SELECT * FROM user WHERE user = 'salam@gmail.comda' LIMIT 1 //coba kamu ganti pakai email SELECT * FROM user WHERE email = 'salam@gmail.comda' LIMIT 1 </pre>

avatar bosque
@bosque

187 Kontribusi 104 Poin

Dipost 4 tahun yang lalu

Tanggapan

Coba deh om liat syntax nya

ka, untuk perbaikannya. itu biasa terletak di file mana ya? soalnya di File DB_DRIVERS baris 691 SELECT * FROM itu tidak ada.

<div class="attachment-gallery attachment-gallery--2"><figure data-trix-attachment="{&quot;contentType&quot;:&quot;image/png&quot;,&quot;filename&quot;:&quot;Doc1_001.png&quot;,&quot;filesize&quot;:65612,&quot;height&quot;:209,&quot;url&quot;:&quot;https://i.ibb.co/D4rbb94/Doc1-001.png&quot;,&quot;width&quot;:396}" data-trix-content-type="image/png" data-trix-attributes="{&quot;presentation&quot;:&quot;gallery&quot;}" class="attachment attachment--preview attachment--png"><img src="https://i.ibb.co/D4rbb94/Doc1-001.png" width="396" height="209"><figcaption class="attachment__caption"><span class="attachment__name">Doc1_001.png</span></figcaption></figure><figure data-trix-attachment="{&quot;contentType&quot;:&quot;image/png&quot;,&quot;filename&quot;:&quot;Doc1,_001.png&quot;,&quot;filesize&quot;:30034,&quot;height&quot;:249,&quot;url&quot;:&quot;https://i.ibb.co/0yYF7pf/Doc1-001.png&quot;,&quot;width&quot;:477}" data-trix-content-type="image/png" data-trix-attributes="{&quot;presentation&quot;:&quot;gallery&quot;}" class="attachment attachment--preview attachment--png"><img src="https://i.ibb.co/0yYF7pf/Doc1-001.png" width="477" height="249"><figcaption class="attachment__caption"><span class="attachment__name">Doc1,_001.png</span></figcaption></figure></div><div>cara mengatasinya gimana mohon bantuannya</div>

avatar bkpsdm833
@bkpsdm833

1 Kontribusi 0 Poin

Dipost 3 tahun yang lalu

Tanggapan

Kalo potongan kode sama keterangan errornya di screenshot itu kurang jelas, coba manfaatin fitur snipet code di forum ini, atau biar lebih rapih, agan bikin thread baru aja.

Login untuk ikut Jawaban