1

the code is written for the connection but the function pg_connect() doesn't work with the framework and database i.e. codeigniter and postgreSQL.

to connect with database i have written the code for the config/database.php but the error is persistent that the connection is unable to connect.

i completed the information for the config/database.php file the details are complete and provided as per requirement for the database connection.

$active_group = 'default';
$query_builder = TRUE;

$db['default'] = array(
    'dsn'   => 'localhost',
    'hostname' => 'localhost',
    'username' => 'puneetchhabra',
    'password' => 'shambhu',
    'database' => 'success_story',
    'dbdriver' => 'postgre',
    'port' => '',
    '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
);

error message

Severity: Warning

Message: pg_connect(): Unable to connect to PostgreSQL server: missing "=" after "localhost" in connection info string

Filename: postgre/postgre_driver.php

Line Number: 154

Unable to connect to your database server using the provided settings.

Filename: core/CodeIgniter.php

Line Number: 518

1
  • based on this qa, try pg_pconnect() instead if you made such calls. try to empty the dsn also. a lot you can try, just keep searching. Commented Oct 9, 2019 at 8:06

1 Answer 1

0

Take out the DSN. You should generally use either an array of parameters, or a DSN string, not both.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.