I was going though the Codeigniter tutorial in the user guide but when I got to the section using the model I got an error saying that the execution timed out. I subsequently increased the php execution time to 1200 and the next error was the maximum nesting level has been been reached at 100, I have subsequently increased it to 200 with the same error.
It appears that its stuck in some kind of nesting loop just referencing the same 4 functions repeatedly.
I am running: Codeigniter 3.0.0 Apache 2.4.9 PHP 5.5.12 SQL Server 2012 Express LocalDB - (Windows Authentication - if that makes a difference)
Part of the Error Message Below:
Fatal error: Maximum function nesting level of '200' reached, aborting! in C:\wamp\www\NewsApp\system\database\DB_driver.php on line 963
Call Stack
Time Memory Function Location
1 0.0010 151936 {main}( ) ..\index.php:0
2 0.0030 197064 require_once( 'C:\wamp\www\NewsApp\system\core\CodeIgniter.php' ) ..\index.php:292
3 0.0360 850512 News->__construct( ) ..\CodeIgniter.php:500
4 0.0390 985568 CI_Loader->model( ) ..\News.php:7
5 0.0410 992936 News_model->__construct( ) ..\Loader.php:305
6 0.0410 993224 CI_Loader->database( ) ..\News_model.php:6
7 0.0420 1016048 DB( ) ..\Loader.php:349
8 0.0520 1612760 CI_DB_driver->initialize( ) ..\DB.php:216
9 0.0520 1612904 CI_DB_sqlsrv_driver->db_connect( ) ..\DB_driver.php:401
10 15.0609 1616496 CI_DB_driver->query( ) ..\sqlsrv_driver.php:147
11 15.0609 1616728 CI_DB_driver->simple_query( ) ..\DB_driver.php:642
12 15.0609 1616728 CI_DB_driver->initialize( ) ..\DB_driver.php:768
13 15.0609 1616728 CI_DB_sqlsrv_driver->db_connect( ) ..\DB_driver.php:401
14 30.0707 1617416 CI_DB_driver->query( ) ..\sqlsrv_driver.php:147
15 30.0707 1617560 CI_DB_driver->simple_query( ) ..\DB_driver.php:642
16 30.0707 1617560 CI_DB_driver->initialize( ) ..\DB_driver.php:768
17 30.0707 1617560 CI_DB_sqlsrv_driver->db_connect( ) ..\DB_driver.php:401
What's going on here?
The model:
<?php
class News_model extends CI_Model {
public function __construct()
{
$this->load->database();
}
public function get_news($slug = FALSE)
{
if ($slug === FALSE)
{
$query = $this->db->get('news');
return $query->result_array();
}
$query = $this->db->get_where('news', array('slug' => $slug));
return $query->row_array();
}
}
Just $this->load->database(); is causing the loop.