12345678910111213141516171819202122 |
- <?php
- $host = "kurek620.beget.tech";
- $username = "kurek620_baze";
- $password = "6910WASD579h";
- $database = "kurek620_baze";
- $mysql = new mysqli($host, $username, $password, $database);
- if($mysql->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');
- ?>
|