Bonjour,
j'ai utilisé ce code trouvé sur le forum :
<?php
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=stat.xls");
mysql_select_db($database_affectation, $affectation);
$query_Recordset1 = "SELECT * FROM demande_balisage";
$Recordset1 = mysql_db_query($query_Recordset1, $affectation);
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalrow_Recordset1 = mysql_num_rows($Recordset1);
$tbl= " <table border='0' cellpadding='0' cellspacing='0'>
<tr bgcolor='#CCCCCC' height='40px'>
<td>employe</td>
<td>rayon</td>
<td>famille</td>
<td>date</td>
</tr>";
do {
$tbl = $tbl . "<tr>";
$tbl = $tbl . "<td>" . $row_Recordset1['employe'] . "</td>";
$tbl = $tbl . "<td>" . $row_Recordset1['rayon'] . "</td>";
$tbl = $tbl . "<td>" . $row_Recordset1['famille'] . "</td>";
$tbl = $tbl . "<td>" . $row_Recordset1['date'] . "</td>";
$tbl = $tbl . "</tr>";
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
$tbl = $tbl . "</table>";
print $tbl ;
?>
et j'obtiens cette erreur dans mon fichier excel
"Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\Program Files\EasyPHP 3.0\www\BALISAGE\statperso.php on line 11"
3 fois ce message concernant les lignes 11, 12 et 28
ou est mon erreur?
merci
