Added database export to CSV

pull/3/head
to3k 2022-11-29 13:56:36 +01:00 zatwierdzone przez GitHub
rodzic 042377d0d5
commit eef178c475
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 11 dodań i 4 usunięć

Wyświetl plik

@ -252,7 +252,8 @@
</thead> </thead>
<tbody> <tbody>
<?php <?php
while($fromdb = mysqli_fetch_row($result)) $export_arr = array();
while($fromdb = mysqli_fetch_row($result))
{ {
//$fromdb[0] - id //$fromdb[0] - id
//$fromdb[1] - twitter_login //$fromdb[1] - twitter_login
@ -273,12 +274,18 @@
echo "<td style=\"white-space: normal\"><a href=\"".$mastodon_link."\" target=\"_blank\">".$fromdb[3]."</a><br>".$fromdb[7]."</highlight_purple></td>"; echo "<td style=\"white-space: normal\"><a href=\"".$mastodon_link."\" target=\"_blank\">".$fromdb[3]."</a><br>".$fromdb[7]."</highlight_purple></td>";
echo "<td style=\"white-space: nowrap\">".$fromdb[9]."</td>"; echo "<td style=\"white-space: nowrap\">".$fromdb[9]."</td>";
echo "</tr>"; echo "</tr>";
$export_arr[] = array($fromdb[1],$fromdb[3],$fromdb[9]);
} }
$serialize_export_arr = serialize($export_arr);
?> ?>
</tbody> </tbody>
</table> </table>
<br>
<br><br> <form method="post" action="download.php">
<textarea name="export_data" style="display: none;"><?php echo $serialize_export_arr; ?></textarea>
<button type="submit" name="Export">Download entire table as a CSV file</button>
</form>
<br>
<label> <label>
<center> <center>
<table style="font-size: 12px;"> <table style="font-size: 12px;">
@ -337,4 +344,4 @@
</script> </script>
</body> </body>
</html> </html>