Ver Mensaje Individual
  #2 (permalink)  
Antiguo 19/05/2005, 21:52
Avatar de Seppo
Seppo
 
Fecha de Ingreso: marzo-2005
Ubicación: Buenos Aires, Argentina
Mensajes: 1.284
Antigüedad: 19 años, 1 mes
Puntos: 17
Buscando por google encontré un par de ejemplos...

http://www.modwest.com/help/kb.phtml?qid=253&cat=6
http://www.phpscripts-fr.net/scripts/script.php?id=982
http://forums.kustompcs.co.uk/showth...0&page=1&pp=15

Uno de ellos es este
Código PHP:
<?
   
# first get a mysql connection as per the FAQ

  
$fcontents file ('./spreadsheet.xls'); 
  
# expects the csv file to be in the same dir as this script

  
for($i=0$i<sizeof($fcontents); $i++) { 
      
$line trim($fcontents[$i]); 
      
$arr explode("\t"$line); 
      
#if your data is comma separated
      # instead of tab separated, 
      # change the '\t' above to ',' 
     
      
$sql "insert into TABLENAME values ('"
                  
implode("','"$arr) ."')"
      
mysql_query($sql);
      echo 
$sql ."<br>\n";
      if(
mysql_error()) {
         echo 
mysql_error() ."<br>\n";
      } 
}
?>