Welcome Guest, Not a member yet? Register   Sign In
How to Connect AWS Redshift database in Codeigniter 3.1.13 ?
#1

How to Connect AWS Redshift database in Codeigniter 3.1.13 ?

I have tried this : 

Database.php
$db['redshift'] = array(
'dsn' => 'odbc:Redshift_dsn',
'hostname' => 'host_name:5439',
'username' => 'username',
'password' => 'password',
'database' => 'database',
'dbdriver' => 'odbc',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);


User_model : 
class User_model extends CI_Model
{

    /** Constructor **/
    function __construct(){
        parent::__construct();
        $this->redshift_db = $this->load->database('redshift', TRUE);
    }

function checkUser($email,$encPwd)
    {
        $this->redshift_db->select('*');
        $this->redshift_db->from('users');
       
        $this->redshift_db->where('email',$email);
        $this->redshift_db->where('password',$encPwd);
       
        return $this->redshift_db->get()->row_array();
    }


But I'm getting this error in view page :
A Database Error Occurred
Unable to connect to your database server using the provided settings.

Filename: F:/wamp64/www/suppression_check/system/database/DB_driver.php

Line Number: 437


Any solution for this issue ??
Reply




Theme © iAndrew 2016 - Forum software by © MyBB