Welcome Guest, Not a member yet? Register   Sign In
Codeignter querying mssql through odbc
#11

[eluser]kikz4life[/eluser]
sorry for the late reply. we had political issue here in phil. xD

my Loader.php where one of my errors occurred
Code:
function dbutil()
    {
        if ( ! class_exists('CI_DB'))
        {
            $this->database();
        }

        $CI =& get_instance();

        // for backwards compatibility, load dbforge so we can extend dbutils off it
        // this use is deprecated and strongly discouraged
        $CI->load->dbforge();

        require_once(BASEPATH.'database/DB_utility'.EXT);
        require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_utility'.EXT);
        $class = 'CI_DB_'.$CI->db->dbdriver.'_utility';

        $CI->dbutil =& new $class(); // --> line 414 where it says that [b]Assigning the return value of new by reference is deprecated[/b]

        $CI->load->_ci_assign_to_models();
    }

The problem is if I upgrade my server xampp 1.7.1 to latest version (ie. xampp 1.7.2/ 1.7.3) my CI application won't run :down:, bcoz of deprecated synthax in PHP 5.3. Have you tried xampp 1.7.1 connecting to MS SQL 2008?.
#12

[eluser]flaky[/eluser]
No I haven't tried connecting with XAMPP 1.7.1 to SQL Server 2008

replace
Code:
$CI->dbutil =& new $class();

with
Code:
$CI->dbutil = new $class();
#13

[eluser]kikz4life[/eluser]
hi there flaky,

did what you said
change
Code:
$CI->dbutil =& new $class();

to
Code:
$CI->dbutil = new $class();

after this it gives me this error

Code:
Fatal error: Class 'Dataset_db' not found in C:\xampp\htdocs\comunionSQL\system\application\libraries\Loader.php  on line 343

Dataset_db is my main model and line 343 in loader.php is within this function:

Code:
function model($model, $name = '', $db_conn = FALSE)
    {
        if (is_array($model))
        {
            foreach($model as $babe)
            {
                $this->model($babe);
            }
            return;
        }

        if ($model == '')
        {
            return;
        }

        // Is the model in a sub-folder? If so, parse out the filename and path.
        if (strpos($model, '/') === FALSE)
        {
            $path = '';
        }
        else
        {
            $x = explode('/', $model);
            $model = end($x);
            unset($x[count($x)-1]);
            $path = implode('/', $x).'/';
        }

        if ($name == '')
        {
            $name = $model;
        }

        if (in_array($name, $this->_ci_models, TRUE))
        {
            return;
        }

        $CI =& get_instance();
        if (isset($CI->$name))
        {
            show_error('The model name you are loading is the name of a resource that is already being used: '.$name);
        }

        $model = strtolower($model);

        // {{{ Matchbox

        $module = $this->_matchbox->argument(3);

        if (!$filepath = $this->_matchbox->find('models/' . $path . $model . EXT, $module)) {
            show_error('Unable to locate the model you have specified: ' . $model);
        }

        // }}}

        if ($db_conn !== FALSE AND ! class_exists('CI_DB'))
        {
            if ($db_conn === TRUE)
                $db_conn = '';

            $CI->load->database($db_conn, FALSE, TRUE);
        }

        if ( ! class_exists('Model'))
        {
            load_class('Model', FALSE);
        }

        // {{{ Matchbox

        require_once($filepath);

        // }}}

        $model = ucfirst($model);

        $CI->$name = new $model();  // --> this is line 343, by removing the (&)sign it doesnt read my main model which is Dataset_db
        $CI->$name->_assign_libraries();

        $this->_ci_models[] = $name;
    }
In my previous server it works but now in xampp 1.7.3 my CI application just crash, :down. What do you think is the problem here?
#14

[eluser]kikz4life[/eluser]
finally solved it Smile




Theme © iAndrew 2016 - Forum software by © MyBB