123456789101112131415161718192021222324252627282930313233 |
- <?php
- require "connectionDb.php";
-
- $customers = $db->query("SELECT * FROM price_update");
- $json_data=[];
- while ($row = $customers->fetchArray()) {
- $details = [
- "Id" => $row['id'],
- "Status" => $row['status'],
- "Timing" => $row['timing'],
- "Create_At" => dateFormatChanger($row['created_at']),
- "Update_At" => dateFormatChanger($row['updated_at']),
- ];
- array_push($json_data,$details);
- }
- $json_data_all = ["data" => $json_data];
- $myfile = fopen("api/v1/UpdatePrices/updatePricesData.txt", "w+") or die("Unable to open file!");;
- fwrite($myfile,json_encode($json_data_all, JSON_PRETTY_PRINT));
- fclose($myfile);
- ?>
|