CodeIgniter Forums
DB Connection Issue - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: DB Connection Issue (/showthread.php?tid=2060)



DB Connection Issue - El Forum - 07-13-2007

[eluser]latuss[/eluser]
Hi all... I got a DB connection problem..
this is my DB config

Code:
$active_group = "default";

$db['default']['hostname'] = "localhost";
$db['default']['username'] = "root";
$db['default']['password'] = "root";
$db['default']['database'] = "test";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['active_r'] = TRUE;
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";

the autoload.php

Code:
$autoload['libraries'] = array('database');

And the Problem?? Blank Screen...
I install phpmyadmin.. and is working with the same params in the config...

any ideas??


ubuntu feisty, php5, mysql5


thks


DB Connection Issue - El Forum - 07-13-2007

[eluser]coolfactor[/eluser]
Can you connect using standard php mysql_connect() function?


DB Connection Issue - El Forum - 07-13-2007

[eluser]latuss[/eluser]
mmm.. I put this in the controller
Code:
function index()
    {
        $this->load->view('welcome_message');
        $link = mysql_connect('localhost:3306', 'root', 'root');
        if (!$link) {
            die('Could not connect: ' . mysql_error());
        }
        echo 'Connected successfully';
        mysql_close($link);
    }

and I get this error

Code:
Fatal error: Call to undefined function mysql_connect() in /var/www/code/system/application/controllers/welcome.php on line 14



DB Connection Issue - El Forum - 07-13-2007

[eluser]latuss[/eluser]
ups... in phpinfo() there is no mysql.... but I got installed the php-mysql module


DB Connection Issue - El Forum - 07-13-2007

[eluser]latuss[/eluser]
na.. now works... but with the mysql_connect manually....


DB Connection Issue - El Forum - 07-13-2007

[eluser]latuss[/eluser]
Ok, solved... I edit the php.ini and add this line

extension=mysql.so

Thanks


DB Connection Issue - El Forum - 07-13-2007

[eluser]coolfactor[/eluser]
Thanks for following up with your solution. Glad you got it fixed.