Welcome Guest, Not a member yet? Register   Sign In
Problem with to_excel helper under CI 2.1.0
#1

[eluser]Ornis[/eluser]
I used to_excel helper (plugin) several times before. However, with version CI 2.1.0 I get errors running the following code:

Code:
public function excel() {
$this->load->helper('to_excel');
$query = $this->db->get('user');
        to_excel($query,'my_excel');
}

The error msg is:

A PHP Error was encountered

Severity: Notice

Message: Undefined property: stdClass::$Type

Filename: mysql/mysql_result.php

Line Number: 89

Any hints? What do I miss here? Thanks.


*******
P.S.
Above code runs perfectly after downgrading system folder to CI 2.0
#2

[eluser]bwamba[/eluser]
I know this isn't the most elegant solution, but defining your environment as 'production' instead of 'development' solves the issue.

In index.php, change

Code:
define('ENVIRONMENT', 'development');

to

Code:
define('ENVIRONMENT', 'production');
#3

[eluser]Bhashkar Yadav[/eluser]
please look at same post http://ellislab.com/forums/viewthread/186762/#884700. it may help you.
#4

[eluser]bwamba[/eluser]
Thanks for the link, but that thread looks like it's pre-2.1.0.
#5

[eluser]bwamba[/eluser]
I figured it out.

Replace

Code:
$query->field_data();

with

Code:
$query->list_fields();

and replace

Code:
$field->name

with

Code:
$field




Theme © iAndrew 2016 - Forum software by © MyBB