Asi dori un mic ajutor am descarcat de pe net un script care genereaza un file excell cu date stabilite . Acum eu asi vrea sa le generez din baza de date in excell .Uitati ce am facut pana acuma dar nu gasesc rezolvarea :
<?php session_start();
#### Roshan's very simple code to export data to excel
#### Copyright reserved to Roshan Bhattarai - nepaliboy007@yahoo.com
#### if you have any problem contact me at http://roshanbh.com.np
#### fell free to visit my blog http://php-ajax-guru.blogspot.com
require_once('../config.php');
$cerereSQL = 'SELECT * FROM `intrari`';
$rezultat = mysql_query($cerereSQL);
while($rand = mysql_fetch_array($rezultat))
{
}
//first of all unset these variables
unset($_SESSION['report_header']);
unset($_SESSION['report_values']);
//note that the header contain the three columns and its a array
$_SESSION['report_header']=array("Destinatie","prenume","varsta");
// now the excel data field should be two dimentational array with three column
for($i=0;$i<=4;$i++) //loop through the needed cycle
{
echo $_SESSION['report_values'][$i][0]="'destinatie'"." ";
echo $_SESSION['report_values'][$i][1]="michael@yahoo.com"." ";
echo $_SESSION['report_values'][$i][2]="Nepal"." ";
echo "<br>";
}
?>
<a href="export_report.php?fn=order_report">Click here to generate report</a>
<!--the export_report.php takes one variable called fn as GET parameter which is name of the file to be generated, if you pass member_report as a value, then the name of the generated file would be member_report.php
-->
Multumesc anticipat si astept un raspuns!O zi frumoasa !
Buna , Ajutor export excell
Moderatori: Zamolxe, Moderatori
-
dechim
- Senior Member
- Mesaje: 1486
- Membru din: Mar Mai 10, 2005 11:53 pm
- Localitate: Drobeta Turnu Severin
Poate te ajuta exemplul asta
http://sourceforge.net/projects/psxlsgen/files/latest/download?source=files
http://sourceforge.net/projects/psxlsgen/files/latest/download?source=files
Cine este conectat
Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 4 vizitatori