Login   Register  
PHP Classes
elePHPant
Icontem

Get rows

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      Simple XLSX  >  All threads  >  Get rows  >  (Un) Subscribe thread alerts  
Subject:Get rows
Summary:Error getting rows from xmlx
Messages:10
Author:Francisco
Date:2012-09-12 19:05:55
Update:2013-04-10 05:15:23
 

  1. Get rows   Reply  
Picture of Francisco
Francisco
2012-09-12 19:05:55
If I select a .xlsx file, this work fine:

$xlsx = new SimpleXLSX($filedir);
$file = $xlsx->rows();
if ($file) {
//code OK
} else {
echo "error";
}


But, if I change the name of any file to XLSX (eg "mv file.ods file.xlsx") and test that code again, it breaks before get into "else". How I can check if the file is a REAL XLSX?


Sorry about my english, and thanks for this php-class!

  2. Re: Get rows   Reply  
Picture of Sergey Shuchkin
Sergey Shuchkin
2012-09-13 09:48:53 - In reply to message 1 from Francisco
try 0.6 version I've added error() & success() methods

$xlsx = new SimpleXLSX('book.xlsx');
if ($xslx->success())
print_r( $xlsx->rows() );
else
echo 'xlsx error: '.$xslx->error();

  3. Re: Get rows   Reply  
Picture of Francisco
Francisco
2012-09-13 21:08:42 - In reply to message 2 from Sergey Shuchkin
Thanks for the new version, but I've downloaded it and seems to be a v0.5.1.
I can't find the "success" method.

  4. Re: Get rows   Reply  
Picture of Sergey Shuchkin
Sergey Shuchkin
2012-09-14 02:28:15 - In reply to message 3 from Francisco
my bad, try now

  5. Re: Get rows   Reply  
Picture of Jaroslav
Jaroslav
2012-09-14 08:07:08 - In reply to message 2 from Sergey Shuchkin
Hi Sergey,
thank you for your great class.
But when I renamed text file for example example.php to example.xlsx and this file exists class returns

"Warning: Invalid argument supplied for foreach() in /var/www/lab/phpclassess/simple-xlsx/simplexlsx.class.php on line 401
xlsx error: Entry not found: _rels/.rels"

Code is:
$xlsx = new SimpleXLSX('example.xlsx');
if ($xlsx->success()) {
print_r( $xlsx->rows() ); //Sheet 1
}
else {
echo 'xlsx error: '.$xlsx->error();
}

  6. Re: Get rows   Reply  
Picture of Sergey Shuchkin
Sergey Shuchkin
2012-09-14 13:22:57 - In reply to message 5 from Jaroslav
try 0.6.1

  7. Re: Get rows   Reply  
Picture of Maulik
Maulik
2013-01-19 10:13:45 - In reply to message 6 from Sergey Shuchkin
I am using 0.6.2 ,still getting same 'Entry not found: _rels/.rels error' while reading xls (not xlsx) file.

  8. Re: Get rows   Reply  
Picture of vma
vma
2013-03-26 13:58:45 - In reply to message 7 from Maulik
Same problem with v0.6.5

  9. Re: Get rows   Reply  
Picture of vma
vma
2013-03-26 14:00:22 - In reply to message 8 from vma
but for an XLSX file (sorry, can't edit my message)

  10. Re: Get rows   Reply  
Picture of RAMESH kanagaraj
RAMESH kanagaraj
2013-04-10 05:15:23 - In reply to message 1 from Francisco
How to get an data from dynamically changed xlsx file.Please can anyone help me? Is any particular functions available in simplexlsx class