connect_error){ die("Ошибка подключения". $mysql->connect_error); } $file = fopen('Statisic.csv', 'w'); fwrite($file, "\xEF\xBB\xBF"); fputcsv($file, array("Логин". ";". "Количестов". ";". "Сумма")); $result = mysqli_query($mysql, "SELECT * FROM `Orders`"); While($Orders = mysqli_fetch_assoc($result)) { fputcsv($file, array($Orders['login']. ";". $Orders['count_order']. ";". $Orders[' summ_order'])); } fclose($file); header('Location: admin_page.php'); ?>