CodeIgniter Forums

Full Version: Fatal error: Call to undefined method Artist::_ci_assign_to_models()
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]tmac[/eluser]
hi, I am creating a page to force download a csv file. I have the error in the topic when i use the following codes.
Code:
// Load the DB utility class
        $this->load->dbutil();

        $query = $this->db->query("SELECT first_name, last_name, addr_line1, addr_line2, city, state, zipcode, phone FROM ".$this->config->item('users_tbl'));

        $delimiter = ",";
        $newline = "\r\n";


            $backup =& $this->dbutil->csv_from_result($query, $delimiter, $newline);
            // Load the download helper and send the file to your desktop

            $this->load->helper('download');
            force_download('user_address.csv', $backup);

Any help on this matter would be greatly appreciated. ThanksSmile

El Forum

[eluser]tmac[/eluser]
Are there any fixes for this?

It seems that this is causing the problem

// Load the DB utility class
$this->load->dbutil();

I noticed this in the documentation
"In order to initialize the Utility class, your database driver must already be running, since the utilities class relies on it."

What does that mean and how to check if my database driver is running?

Thanks for any help on this. BTW I am running 1.6