Quote:where $ username is my username and $ password is my password but (obviously i cant show it).
I interpret that to mean that
PHP Code:
$db['default']['username'] = '$username';
$db['default']['password'] = '$password';
is actually something like
PHP Code:
$db['default']['username'] = 'rhodoscoder';
$db['default']['password'] = 's3krEt';
so the problem isn't that you're actually surrounding variables with single quotes.
But everything else looks fine. This is where a debugger comes in handy.
Line 124 of DB_driver.php just sends the error message. The error actually occurs before, when depending on the pconnect setting, either db_pconnect() or db_connect() are called in mysql_driver.php. Since you have pconnect set to FALSE, the error must be coming from db_connect(), which starts at line 66 of mysql_driver.php (assuming CI 2.1.2, I guess).
Normally, you never modify the core files, but the only thing that occurs to me here is to place some strategic var_dumps to see if the function is receiving the correct parameters.
PHP Code:
function db_connect()
{
if ($this->port != '')
{
$this->hostname .= ':'.$this->port;
}
var_dump ($this->hostname, $this->username, $this->password); exit;
return @mysql_connect($this->hostname, $this->username, $this->password, TRUE);
}
The values will almost certainly be wrong, but what are they? Finding that out may help you troubleshoot further. And of course, put things back the way they were when you're done.
Hey, don't work without a PHP debugger. Several free IDEs have this features built in. Two are NetBeans and CodeLobster. Without a debugger, it's like you're driving with a blindfold on -- you are going to crash!