I have a database credentials where some escape characters are present in password like \ and '
Below is the actual password: 12r\3u%DMRCy'\q!@W2aq
I want use that password by escaping these characters, however codeigniter shows error
when used password with double quote, single quote and escape strings like below in database.php
'password' => "12r\3u%DMRCy'\q!@W2aq"
'password' => "12r\\3u%DMRCy'\q!@W2aq"
'password' => '12r\\3u%DMRCy\'\\q!@W2aq'
It shows below error.
Message: pg_connect(): Unable to connect to PostgreSQL server: missing "=" after "\q!@W2aq'" in connection info string
However when tried to echo like below it perfectly prints my original password 12r\3u%DMRCy'\q!@W2aq
echo '12r\\3u%DMRCy\'\\q!@W2aq';
echo "12r\\3u%DMRCy'\q!@W2aq";
Below is the sample code of connection in database.php
$db['staging_db'] = array(
'dsn' => '',
'hostname' => 'test.rds.amazonaws.com',
'username' => 'test_username',
'password' => "12r\\3u%DMRCy'\q!@W2aq",
'database' => 'staging',
'dbdriver' => 'postgre',
'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,
'port' => 5432,
);
Can anyone please suggest how can I use my above mentioned password in database.php with codeigniter?