I get this error from the script below:
[text]Notice: Undefined variable: csv_output in C:\xampp\phpMyAdmin\site-2016\csv_vs.php on line 14
Notice: Use of undefined constant email - assumed 'email' in C:\xampp\phpMyAdmin\site-2016\csv_vs.php on line 14[/text]
Then I get loads of the "constant email" script error.
The field is named email. And the other fields are correct.
Code: Select all
$todaydate = date('Y-m-d');
include "dbconn.php";
$result = mysql_query("SELECT email FROM admin WHERE usertype = 'customer'");
while($row = mysql_fetch_array($result))
{
$csv_output .= '"'.$row[email].'"';
$csv_output .= "\015\012";
}
//You cannot have the breaks in the same feed as the content.
header("Content-type: application/vnd.ms-excel");
header("Content-disposition: csv; filename=VS_EmailStore_" . date("Y-m-d") .".csv");
print $csv_output;
exit;
mysql_close($sqlconn);
echo "Extract in progress - one moment please...";