I\'m loading data from my database, and exporting to an Excel file via a method I found on this site: http://www.appservnetwork.com/modules.php?name=News&file=article&am
query($sql);
$filename = "Tutoring_Log.xls";
$contents = "Recap# \t Tutor Name \t Client Name \t Child Name \t Type of tutoring \t Date of Tutoring session \t Hours tutored \t Billable Travel \t Billable Additional \t Total Billable \t Client Rate \t Tutor Pay Rate \t \n";
$contents .= " \n";
while($tutorRecords = $db->fetchNextObject($totallogs)){
$contents .= "".$tutorRecords->id." \t ".$tutorRecords->tutor_first_name.' '.$tutorRecords->tutor_last_name." \t ".$tutorRecords->first_name.' '.$tutorRecords->last_name." \t ".$tutorRecords->first.' '.$tutorRecords->last." \t ".$globalsConstant['type_of_tutoring'][$tutorRecords->type_of_tutoring]." \t ".date(MDY,$tutorRecords->date_of_tutoring_session)." \t ".str_replace('.',':',$tutorRecords->hours_tutored)." \t ".str_replace('.',':',$tutorRecords->billable_travel)." \t ".str_replace('.',':',$tutorRecords->billable_additional)." \t ".str_replace('.',':',$tutorRecords->total_billable)." \t ".CURRENCY.$tutorRecords->rate." \t ".CURRENCY.$tutorRecords->tutor_pay_rate." \t \n";
}
header('Content-type: application/ms-excel');
header('Content-Disposition: attachment; filename='.$filename);
echo $contents;
?>