Не могу данный код
$query = "
SELECT autor, title
FROM dle_post
WHERE autor =''
AND UNIX_TIMESTAMP(date)>UNIX_TIMESTAMP('$from')
AND UNIX_TIMESTAMP(date)<UNIX_TIMESTAMP('$till')
";
$headings = array('Автор', 'Название', 'Размер');
if ($result = mysql_query($query) or die(mysql_error())) {
$objPHPExcel = new PHPExcel();
$objPHPExcel->getActiveSheet()->setTitle('Список загруженных файлов');
$rowNumber = 1;
$col = 'A';
foreach($headings as $heading) {
$objPHPExcel->getActiveSheet()->setCellValue($col.$rowNumber,$heading);
$col++;
}
// Loop through the result set
$rowNumber = 2;
while ($row = mysql_fetch_row($result)) {
$col = 'A';
foreach($row as $cell) {
$objPHPExcel->getActiveSheet()->setCellValue($col.$rowNumber,$cell);
$col++;
}
$rowNumber++;
}
// Freeze pane so that the heading line won't scroll
$objPHPExcel->getActiveSheet()->freezePane('A2');
// Save as an Excel BIFF (xls) file
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="userList.xls"');
header('Cache-Control: max-age=0');
$objWriter->save('php://output');
exit();
}
Преобразовать в CI подобный. Точнее сгенерировать правильно запрос ввода в БД). Туплю на while ($row = mysql_fetch_row($result)) {