query($sql)
or die("Couldn't execute query:
" . mysql_error(). "
" . mysql_errno());
$now_date = date('d.m.Y-Hi');
//header info for browser
header('Content-Encoding: UTF-8');
header("Content-type: text/csv; charset=UTF-8");
#header("Content-Type: text/comma-separated-values;charset=UTF-8");
echo "\xEF\xBB\xBF";
header("Content-Disposition: attachment; filename=export_bewertung_$now_date.csv"); //header("Content-Disposition: attachment; filename=database_dump.$file_ending");
header("Pragma: no-cache");
header("Expires: 0");
/*
if ($Use_Title == 1){
echo("$title\n");
}
*/
//define separator (defines columns in excel & tabs in word)
$sep = ";"; //tabbed character
//start of printing column names as names of MySQL fields
for ($i = 0; $i < mysqli_num_fields($result); $i++) {
echo mysqli_fetch_field_direct($result,$i)->name . ";";
}
print("\n");
//end of printing column names
//start while loop to get data
/*
note: the following while-loop was taken from phpMyAdmin 2.1.0.
--from the file "lib.inc.php".
*/
while($row = $result->fetch_array())
{
//set_time_limit(60); // HaRa
$schema_insert = "";
for($j=0; $j