• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is my database library missing?

#11
[eluser]Derek Allard[/eluser]
walter, we need errors. Are you getting errors? If so, please post. If not, then we need to get them.

#12
[eluser]walterbyrd[/eluser]
Usually, I do get error messages with CodeIgnitor. But when I include this in my autoloader.php:

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

I only get blank pages.

Is there a way that I can try to connect to my db without using autoload? That way, at least I'd know if my database is setup correctly.

Everything seems to work if I don't try to load the database library. Autoloading other libraries seems to work okay.

#13
[eluser]Derek Allard[/eluser]
You bet. Take it out of autoload and instead try
Code:
$this->load->database();
in your controller.

#14
[eluser]walterbyrd[/eluser]
Okay, I put this in my blog.php controller:

function Blog()
{
parent::Controller();
$this->load->database('Blog');
// $this->load->scaffolding('entries');
}

This is the URI: http://localhost/ci/index.php/blog

And this is the error message:

An Error Was Encountered
You have specified an invalid database connection group: Blog

Again, my mysql settings:


$active_group = "default";

$db['default']['hostname'] = "localhost";
$db['default']['username'] = "walter";
$db['default']['password'] = "xxxxxx";
$db['default']['database'] = "Blog";
$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'] = "";

Thanks for all your help.

#15
[eluser]Derek Allard[/eluser]
Aha, now we're getting somewhere.

Code:
function Blog()
{
parent::Controller();
//$this->load->database(’Blog’); // get rid of 'blog' in there...
$this->load->database();
// $this->load->scaffolding(’entries’);
}

#16
[eluser]walterbyrd[/eluser]
I tried that, but it went back to blank pages.

I guess there must be something wrong with the mysql setup. Although, I don't know what. I can access mysql from anywhere at the CLI, with the same login etc. that I have defined in the database.php file.

I try some simple php apps and see if I can access the database like that. If I can't figure it out, maybe I'll try SQLite.

Thanks again for all your help.

#17
[eluser]walterbyrd[/eluser]
After some experimenting, and googling, I don't think this is a codeignitor issue at all. The problem, I think, is my php setup. Maybe a linux guru can help me. I am using debian 4, apache 1.3, and php4.

1) Seems, I didn't install the php4-mysql library. So I took care of that.

2) Also, it seems you have to edit the /etc/php4/apache/php.ini file, and uncomment the following line:

;extensions=mysql.so

So I did that.

3) I tried stopping and re-starting apache, but that still didn't do it.

I think I'm on the right track, but still having trouble.

#18
[eluser]Michael Wales[/eluser]
Apache 1.3x on Unix Systems
Debian GNU/Linux Installation Notes

#19
[eluser]walterbyrd[/eluser]
I think I've fixed it. At least, I'm not getting blank pages, or error messages.

After some experimenting, and googling, I found that it wasn't a codeignitor problem, but a php4 installation/configuration problem.

Here is what I did:

1) installed the php4-mysql module.

2) edited /etc/php4/apache/php.ini, and uncommented this line:

;extensions=mysql.so

3) I tried stopping and re-started apache, but that didn't work. So I rebooted, and that did it.

Thanks again for all the help. I really thought it had to be a codeignitor problem.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.