<?php
header("Content-type: application/x-msdownload");
header("Content-Disposition: attachment; filename=extraction.csv");
header("Pragma: no-cache");
header("Expires: 0");
require_once( "db.php" );
$query = "SELECT * FROM name ORDER BY last";
$result = mysql_query($query) or die(mysql_error());
echo "ID,First,Middle,Last,Email\r\n"; //header
while($row = mysql_fetch_array($result)){
echo "\"$row[id]\",\"$row[first]\",\"$row[middle]\",\"$row[last]\",\"$row[email]\"\r\n"; //data
}
?>
csshacker 0 Newbie Poster
nav33n 472 Purple hazed! Team Colleague Featured Poster
csshacker 0 Newbie Poster
suhnako 0 Newbie Poster
rpv_sen 59 Junior Poster
Stefano Mtangoo 455 Senior Poster
suhnako 0 Newbie Poster
kundan.ignou 0 Newbie Poster
diafol
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.