Welcome Guest, Not a member yet? Register   Sign In
Auto-load Libraries
#1

[eluser]myjeep_2003[/eluser]
As per the 1.7 CI

User Manual..............

The "auto connect" feature will load and instantiate the database class with every page load.
To enable "auto connecting", add the word database to the library array, as indicated in the
following file:
application/config/autoload.php

I loaded the following in the autoload.php
$autoload['libraries'] = array('database', 'session', 'xmlrpc');

After I load my View diappears and will apear only after I take out Database.

After looking the the /system/library folder, I do not see database.php. I downloaded the CI again and still NO database.php...

Please help me figure out this... I am very Newbie......
#2

[eluser]darkhouse[/eluser]
Well, first, there is no database.php file in the /system/libraries folder, so good news, you're not going crazy. Database is a special class because CI allows you to use different databases, not just MySQL. I suspect however that yours is a simple case of creating a database connection in the /system/config/database.php file. It sounds like you have no database linked up (or something typed wrong) and it's producing an error but either error_reporting or display_errors is off and that's why you get a blank screen.

That's my theory anyways.
#3

[eluser]Adam Griffiths[/eluser]
That's because the database library is a set of files located in system/database.

No idea why your view doesn't appear though.

Edit: damn you darkhouse, beat me to the mark; with a much better answer too!
#4

[eluser]Colin Williams[/eluser]
Every time my database config settings are wrong, I get a white screen too. So, check your database connection settings in application/config/database.php
#5

[eluser]darkhouse[/eluser]
Sorry Adam, I'll try less next time hehe.
#6

[eluser]myjeep_2003[/eluser]
I get it but here is what I have tried so far...on database.php

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

on Index.php

error_reporting(E_ALL ^ E_NOTICE);

on Myssl Admin I can login using the user

username and password.. and see the database...




Theme © iAndrew 2016 - Forum software by © MyBB