PHP - Codeigniter - Connecting to a PostgreSQL error -


i new on codeigniter , connect postgres. when filling data in login page , press submit button show error.

error number:

error: column "id" not exist line 1: select "id", "user_name", "user_pass" ^  select "id", "user_name", "user_pass" "admin" "user_name" = 'aziz' , "user_pass" = 'aziz12' limit 1  filename: c:\wamp\www\ci_login\system\database\db_driver.php  line number: 331 

in codeigniter config->database.php file configuration is

$active_group = 'default'; $active_record = true;  $db['default']['hostname'] = 'localhost'; $db['default']['username'] = 'postgres'; $db['default']['password'] = 'postgres'; $db['default']['database'] = 'login'; $db['default']['dbdriver'] = 'postgre'; $db['default']['dbprefix'] = ''; $db['default']['pconnect'] = true; $db['default']['db_debug'] = true; $db['default']['cache_on'] = false; $db['default']['cachedir'] = ''; $db['default']['char_set'] = 'utf8'; $db['default']['dbcollat'] = 'utf8_general_ci'; $db['default']['swap_pre'] = ''; $db['default']['autoinit'] = true; $db['default']['stricton'] = false; $db['default']['port'] = 5432; 

hi query should this

select id, user_name, user_pass admin user_name = 'aziz' , user_pass = 'aziz12' limit 1 

in ci use below code

$this->db->select("id, user_name, user_pass admin"); $this->db->from("admin"); $this->db->where("user_name","aziz"); $this->db->where("user_pass","aziz12"); $this->db->limit(1); $query = $this->db->get(); echo "<pre>";print_r($query->row_array()); 

thanks


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -