Bonjour ,

j'ai fait un script pour essayer d'exporter le contenu d'une table cependant lors de l'exporte mon fichier contient aucun enregistrement.

Voici mon script si vous pouvez m'aiguiller

merci

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
 
include_once('/connect.php');
$fichier_csv = "Code client;nom;adresse;email;telephone";
$ligne = "\n";
 
$req=$bdd->query('SELECT id_client,nom_client,adresse_client,email_client,telephone_client FROM Client ORDER BY ID_Client ASC ');
 
while($export = $req->fetch())
							{
							$ligne = $export['id_client'];
										   $export['nom_client'];
										   $export['adresse_client'];
										   $export['email_client'];
										   $export['telephone_client'];'\n';		
							}
header("Content-type: application/vnd.ms-excel");	
header("Content-disposition: attachment; filename=Export_client" . date("Ymd").".csv");						
print $fichier_csv;
exit;
?>