|
|
@ -1,24 +1,10 @@ |
|
|
|
<?php |
|
|
|
|
|
|
|
// $connect = mysqli_connect("localhost", "root", "", "ticket"); |
|
|
|
// $query = "SELECT * FROM `" .$_POST['bdd'] ."`"; |
|
|
|
// $title = array_keys(mysqli_fetch_assoc(mysqli_query($connect, $query))); |
|
|
|
// |
|
|
|
// header('Content-Type: text/csv; charset=utf-8'); |
|
|
|
// header('Content-Disposition: attachment; filename=' .$_POST['bdd'] .'.csv'); |
|
|
|
// $output = fopen("php://output", "w"); |
|
|
|
// fputcsv($output, $title); |
|
|
|
// $result = mysqli_query($connect, $query); |
|
|
|
// while($row = mysqli_fetch_assoc($result)) { |
|
|
|
// fputcsv($output, $row); |
|
|
|
// } |
|
|
|
// fclose($output); |
|
|
|
// |
|
|
|
|
|
|
|
$bdd = new SQLite3('../../database/ticket_panne.db', SQLITE3_OPEN_READWRITE); |
|
|
|
$stmt = $bdd->prepare("SELECT * FROM :base"); |
|
|
|
$stmt->bindValue(':base', $_POST['bdd']); |
|
|
|
$title = array_keys($stmt->fetchArray(SQLITE3_ASSOC)); |
|
|
|
$stmt = $bdd->prepare('SELECT * FROM :base'); |
|
|
|
$stmt->bindParam(':base', $_POST['bdd']); |
|
|
|
$res = $stmt->execute(); |
|
|
|
$title = array_keys($res->fetchArray(SQLITE3_ASSOC)); |
|
|
|
|
|
|
|
header('Content-Type: text/csv; charset=utf-8'); |
|
|
|
header('Content-Disposition: attachment; filename=' .$_POST['bdd'] .'.csv'); |
|
|
|