October 11, 2008, 20:33:42 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Revenue sharing launched. This is offered as a "thank you" for being a member of webmasterstalks.com community! If you have an Adsense/Yahoo publisher account then you can start right away !
 
  Home   Forum   Help Search Directory Calendar Login Register    RSS 2.0 feedAtom feed


News
Revenue sharing launched. This is offered as a "thank you" for being a member of webmasterstalks.com community! If you have an Adsense/Yahoo publisher account then you can start right away !
Pages: [1]
  Print  
Author Topic:

Importing cells from Excel into Tables in PHP

 (Read 797 times)
0 Members and 1 Guest are viewing this topic.
drunkenglishman
Jr. Member
**

Points: 0
Offline Offline

Posts: 7


« on: February 07, 2007, 18:00:59 »

Does anyone know how I do this? I have a feeling it's the same as in HTML, however, when I try to import from Excel, I get the whole worksheet and not the cells I need...


Can anyone shed some light on it please?

Thanks
Logged


TheGodFather
Administrator
Hero Member
*****

Points: 202
Offline Offline

Posts: 2570



WWW
« Reply #1 on: February 07, 2007, 20:02:41 »

Do you want to read an xls file in php ?

Read the info from this link  http://www.phpclasses.org/browse/package/1919.html... it also provides some code examples ... but you need to register there Smiley

Regards
Logged

drunkenglishman
Jr. Member
**

Points: 0
Offline Offline

Posts: 7


« Reply #2 on: February 07, 2007, 20:55:12 »

Either a .xls file or .csv file

But thank you, I shall register and read your suggestion...

Thank you! Smiley
Logged
TheGodFather
Administrator
Hero Member
*****

Points: 202
Offline Offline

Posts: 2570



WWW
« Reply #3 on: February 07, 2007, 21:39:21 »

csv is more simple ... just "explode" line by line after comma (,) Smiley

Regards

Logged

drunkenglishman
Jr. Member
**

Points: 0
Offline Offline

Posts: 7


« Reply #4 on: February 07, 2007, 21:54:02 »

I'm sorry! I have no idea what that means!

To be honest, the link you sent me was a little alien to me and I don't understand what the guy is saying. I'm just kind of looking for instructions in plain English.

I'm a bit of a dummy when it comes to this and I'm a total novice.

Sorry, maybe I should just stick to plain html!

Regards
Logged
TheGodFather
Administrator
Hero Member
*****

Points: 202
Offline Offline

Posts: 2570



WWW
« Reply #5 on: February 07, 2007, 22:37:51 »

Just try to learn some php ... is not so hard... anyway a fast solution is:
Code:
<?php
$row 
1;
$handle fopen("test.csv""r");
while ((
$data fgetcsv($handle1000",")) !== FALSE) {
   
$num count($data);
   echo 
"<p> $num fields in line $row: <br /></p>\n";
   
$row++;
   for (
$c=0$c $num$c++) {
       echo 
$data[$c] . "<br />\n";
   }
}
fclose($handle);
?>


http://www.php.net/fgetcsv

Regards
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.4 | SMF © 2006, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks

TinyPortal v0.9.7 © Bloc
Valid XHTML 1.0! Valid CSS!