if i understand this correct placing this: header("Content-type: text/csv\n"); line of code in your script makes it so when the user enters the url in, they will be asked to download a csv file?
never worked with csv files before..but i tried this:
<?
header("Content-type: text/csv\n");
include '../db.php';
$result = mysql_query("SELECT * FROM lasik_consults ORDER BY id");
while ($myrow = mysql_fetch_array($result, MYSQL_ASSOC)) {
print $myrow["first_name"].",";
print $myrow["last_name"].",";
print $myrow["email_address"]."\n";
}
?>
and it asks to save a php file...is this how everyone does it..it asks to save a php and you just rename it to a csv file? it would be so much easier if it would ask to save a file with the .csv extension.
should i be using this method or..i was thinking..i already have a page for the client to go to, to view a list of things...maybe when they go to that page..i could re-write a csv file, and then they could click a link on the page that would save/open that csv file.
thanks for your help