Welcome Guest, Not a member yet? Register   Sign In
Getting Error with Excel_reader Class
#1

[eluser]Monisha[/eluser]
Hi All..

I want to connect Excel with database and as a first step I use Excel_reader class library from wiki http://codeigniter.com/wiki/Excel_Reader_Class/

I have created Controller myexcelreader.php file :
Code:
<?php

class myexcelreader extends Controller{
    
    function myexcelreader(){
        parent :: Controller();
    }
    

function index(){

    // Load the spreadsheet reader library
    $this->load->library('Excel_reader');

    // Read the spreadsheet via a relative path to the document
    $this->excel_reader->read('./uploads/testfile.xls');
    
    // Get the contents of the first worksheet
    $worksheet = $this->Excel_reader->worksheets[0];
    
}

}

and placed class file inside system/libraries/Excel_reader.php. Its showing me error when i try to get output on : http://localhost/CI/index.php/myexcelreader




A PHP Error was encountered
Severity: Notice
Message: Undefined property: excelreader::$Excel_reader
Filename: controllers/excelreader.php
Line Number: 22

A PHP Error was encountered
Severity: Notice
Message: Trying to get property of non-object
Filename: controllers/excelreader.php
Line Number: 22




Can anyone give me solution what should I do??

Thanks in advance.




Theme © iAndrew 2016 - Forum software by © MyBB