Files
Siro/walletintaleq.intaleq.xyz/v2/main/ride/promo/getPromoBytody.php
2026-06-11 18:22:59 +03:00

21 lines
544 B
PHP

<?php
include "../../connect.php";
// $promo_code = filterRequest("promo_code");
$sql = "SELECT `id`, `promo_code`, `amount`, `description`, `validity_start_date`, `validity_end_date` FROM `promos` WHERE `validity_start_date`=CURDATE();";
$stmt = $con->prepare($sql);
$stmt->execute();
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
if ($result) {
// Print all promo records
printSuccess( $result);
} else {
// Print a failure message
printFailure($message = "Failed to retrieve promo records");
}
?>