jasonrogena / php-excel-reader

Automatically exported from code.google.com/p/php-excel-reader
1 stars 0 forks source link

problem with excel_reader2.php #89

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
after several months without problems

an error appears on the function: OLERead ()

"Deprecated: Assigning The return value of new by reference is deprecated in / 
home/ach/public_html/01_www/googlemaps/admin/lib/Excel/reader.php on line 916
The filename .. / .. / gmaps / gmaps.xls is Not readable "

Line 916: $ this-> _ole OLERead = & new ();

No longer works on php 5.2.11 (production server) and 5.3.2-2 (test server) on 
two different servers

same error with the example for download with the error:

"Deprecated: Assigning The return value of new by reference is deprecated in / 
home/ach/public_html/01_www/php-excel-reader-2.21/excel_reader2.php on line 916

Deprecated: Function Split () is deprecated in / 
home/ach/public_html/01_www/php-excel-reader-2.21/excel_reader2.php on line 844

Deprecated: Function Split () is deprecated in / 
home/ach/public_html/01_www/php-excel-reader-2.21/excel_reader2.php on line 844

... "

Original issue reported on code.google.com by ache...@gmail.com on 6 Oct 2010 at 5:20

Attachments:

GoogleCodeExporter commented 9 years ago
Hi!
I have the same error. 
Do you know the reason and how to fix it?

Regards,
Miguel.

Original comment by paniagua...@gmail.com on 3 Nov 2010 at 8:36

GoogleCodeExporter commented 9 years ago
Again here.

My problem was that the FULL path to the file was too long.
In my case, files are always in the same folder [xls/].
I take the FULL path Explode it and take the last token.

$file="/home/user/main/xls/file.xls"; 
$tokens=explode('/',$file);
$the_file=array_pop($tokens);
echo $the_file;

It'd give us
file.xls

Original comment by paniagua...@gmail.com on 3 Nov 2010 at 12:05

GoogleCodeExporter commented 9 years ago
correct the line 916 : $this-> _ole OLERead = & new ();
 by                  : $this->_ole = new OLERead();

Original comment by ache...@gmail.com on 3 Nov 2010 at 1:21

GoogleCodeExporter commented 9 years ago
to solve line 916: $this->_ole =& new OLERead();  (it's Deprecated "=&" , put 
only "=") 
          $this->_ole = new OLERead();

to solve line 844 (and other with split like):   $parts = split(";",$format); 
Split it's been Deprecated use instead "explode":$parts = explode(";",$format); 

Original comment by emiliano...@gmail.com on 5 Nov 2010 at 5:38

GoogleCodeExporter commented 9 years ago
brilliant.. the replacement worked like a charm... 
thanks emiliano

Original comment by v.athani...@gmail.com on 23 May 2011 at 2:23

GoogleCodeExporter commented 9 years ago
To replace this line

$this->_ole = new OLERead();

Original comment by sahulham...@gmail.com on 29 Mar 2012 at 7:06

GoogleCodeExporter commented 9 years ago
help me please!!!!!and sorry for may bad English
I fix all the you recomend, 
I use this class for my file, look my out:
Notice: Uninitialized string offset: 151052498 in 
D:\work\project.md\public\intro\excel-reader-2\excel_reader2.php on line 917
I't understend fix it! 
I attach my problems excel

Original comment by moldoven...@gmail.com on 6 Jun 2012 at 3:15

Attachments:

GoogleCodeExporter commented 9 years ago
Hi there..

I have tried the above mentioned fixes.

However it is not working... below are the errors are that i get.

Assigning the return value of new by reference is deprecated

.phpLine Number: 917

Hoping for a solution please help!!!

Original comment by hasansal...@gmail.com on 15 Jul 2012 at 6:15

GoogleCodeExporter commented 9 years ago
Thaaaaanks :)

Original comment by Rtri...@gmail.com on 8 Oct 2012 at 9:27

GoogleCodeExporter commented 9 years ago
To replace this line

$this->_ole = new OLERead();

i can import ...thanks 

Original comment by ngras...@gmail.com on 7 Dec 2012 at 8:21

GoogleCodeExporter commented 9 years ago
thanks, now it's working for me.......

Original comment by muhammad...@gmail.com on 3 May 2013 at 7:10

GoogleCodeExporter commented 9 years ago
when i use the code $this->_ole = new OLERead(); 
the code still error : The filename C:\Users\ACER\xampp\tmp\php4DE0.tmp is not 
readable

anyone please help me.thanks

Original comment by pensilh...@gmail.com on 6 Jul 2013 at 7:42

GoogleCodeExporter commented 9 years ago
i had the same problem (is not readable), just try to change to a relative path 
instead of absolute.

Original comment by rosendo....@gmail.com on 20 Sep 2013 at 8:28

GoogleCodeExporter commented 9 years ago
I have the same problem, file is not readable. I checked the line 916 and it's 
already $this->_ole = new OLERead(); so I don't think the problem is there... 
Any suggestions?

Original comment by glaucima...@gmail.com on 21 May 2014 at 7:13

GoogleCodeExporter commented 9 years ago
#14
specify the absolute path to the file and check the permissions for files

Original comment by my.site....@gmail.com on 27 May 2014 at 2:48

GoogleCodeExporter commented 9 years ago
Please replace "split" with "explode"
http://php.net/explode

Original comment by anggola....@gmail.com on 20 Jan 2015 at 12:20

Attachments:

NYC-Jim commented 6 years ago

Thank you for the fix emiliano. It's been over 7 years now, but that fix still works like a charm!!

Original comment by emiliano...@gmail.com on 5 Nov 2010 at 5:38

spicephp commented 6 years ago

I 've used the class excel_reader2.php for reading a excel file it has some formula so it returns an error as The filename booking.xls is not readable not readable ". but when we remove all formula to xls manually then its readable so, can you share idea how we disable formula programmatically when we read xls file .

rusmala81 commented 5 years ago

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; OLERead has a deprecated constructor in /home/elbasmoc/public_html/excel_reader2.php on line 95

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Spreadsheet_Excel_Reader has a deprecated constructor in /home/elbasmoc/public_html/excel_reader2.php on line 312

Notice: Undefined variable: query in /home/elbasmoc/public_html/proses.php on line 39

Fatal error: Uncaught Error: Function name must be a string in /home/elbasmoc/public_html/proses.php:39 Stack trace: #0 {main} thrown in /home/elbasmoc/public_html/proses.php on line 39 help mee...

velayanireza commented 4 years ago

$this->_ole = new OLERead(); Result : data not inserted in database mysql