Welcome Guest, Not a member yet? Register   Sign In
Problem with Database Library
#1

[eluser]Einspruch[/eluser]
I accidentally posted this question in the wrong part of the forum yesterday. But to follow-up on some other threads, I am having the problem where the page goes blank when the database library is included in the autoload.php file. Any suggestions? Thanks!
#2

[eluser]TheFuzzy0ne[/eluser]
That indicates that the database configuration is incorrect. Double-check it, fix the problem, and all should be well. Smile
#3

[eluser]Einspruch[/eluser]
Does anything leap out at you?

Code:
$active_group = "default";
$active_record = TRUE;

$db['default']['hostname'] = "localhost";
$db['default']['username'] = "XXXXXXX";
$db['default']['password'] = "XXXXXXX";
$db['default']['database'] = "digital";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";

Via Terminal I am able to ssh to the box and log into the MySQL db using those credentials, so I know it is not a U/P issue.
#4

[eluser]TheFuzzy0ne[/eluser]
No, everything looks OK to me. But if you're sure that everything works until you load the database, then it must have something to do with that. I know this sounds like an obvious question, but are you absolutely certain it's a MySQL database?

EDIT: You might want to consider trying the mysqli driver instead, and see if that makes any difference.
#5

[eluser]Einspruch[/eluser]
It is definitely a MySQL installation and, for the heck of it, I tried the 'mysqli' setting and that did not work either.
#6

[eluser]JayTee[/eluser]
Have you tried a generic non-CI php page?
Code:
<?php
$conn = mysql_connect('localhost','user','password');
if (!$conn) {
  die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($conn);
?>
#7

[eluser]Einspruch[/eluser]
Thank you for that huge tip. It did not connect and I was getting the following error:

Code:
Fix Fatal error: Call to undefined function: mysql_connect()

So I googled that error and found this link: http://www.idealog.us/2005/01/howto_fix_fatal.html

It ends up it was something with my PHP installation.

Thanks for the clue!
#8

[eluser]TheFuzzy0ne[/eluser]
Well done! I never would have suspected that. I would have thought you would have been stung with that error when you loaded the database class. Evidently not...




Theme © iAndrew 2016 - Forum software by © MyBB