Welcome Guest, Not a member yet? Register   Sign In
Autoload.php core ?
#1

[eluser]Evollution[/eluser]
i wached your tutorial how to make a blog and when i try to add auto load classes

"$autoload['core'] = array();"

o cannot find $autoload['libraries'] = array(); in autoload.php i trayed to add manually this code but i get an error
Code:
A PHP Error was encountered

Severity: Notice

Message: Use of undefined constant database - assumed 'database'

Filename: config/autoload.php

Line Number: 122
#2

[eluser]Evollution[/eluser]
where is active comunity ?!
#3

[eluser]bl00dshooter[/eluser]
[quote author="Evollution" date="1293042375"]where is active comunity ?![/quote]

Where is the patience, young one? We're a community that is here to help, not to be your private tutors to answer questions in 1 hour or so.

FYI, CI doesn't have autoload['core'] anymore. Thus, if it's a library, you should add it into autoload['libraries'] in autoload.php.
If it gives a error, post your code.
#4

[eluser]Evollution[/eluser]
so i added

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

and i get error
----------------------------------
A PHP Error was encountered

Severity: Notice

Message: Use of undefined constant database - assumed 'database'

Filename: config/autoload.php

Line Number: 42
----------------------------------
database config:

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

[eluser]bl00dshooter[/eluser]
[quote author="Evollution" date="1293043011"]so i added
$autoload['libraries'] = array(database);

and i get error
----------------------------------
A PHP Error was encountered

Severity: Notice

Message: Use of undefined constant database - assumed 'database'

Filename: config/autoload.php

Line Number: 42
----------------------------------
[/quote]

You're missing the quotes in database. Change that line to:
Code:
$autoload['libraries'] = array('database');
#6

[eluser]Evollution[/eluser]
o txn a lot
#7

[eluser]adityajoshi[/eluser]
thanks a lot from this little one also because this thread really helped me
#8

[eluser]InsiteFX[/eluser]
Also Controller is now CI_Controller
and Model is now CI_Model

InsiteFX
#9

[eluser]Temereto[/eluser]
Struct with the same problem.
After adding $autoload['libraries'] = array('database');
I got an error

HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request

My model
class User_model extends CI_Model {

function getall(){
$q = $this->db->get('admin','desc');
if($q->num_rows() > 0)
{
foreach ($q->result() as $row)
{

$data[]=$row;
}
}
return $data;

}
}

My controller
class Home extends CI_Controller{

function index(){
$this->load->model('user_model');
$data['records']=$this->user_model->getall();
}

}

Can anyone please help me in this issue
Thanks in advance
#10

[eluser]InsiteFX[/eluser]
Autoload ./application/config/autoload.php

Server 500 is a server error not CodeIgniter!

Are you sure you started the MySQLs sever first along with Apache server?




Theme © iAndrew 2016 - Forum software by © MyBB