load(); function load() { $dbh=new PDO('mysql:host=172.18.8.111;dbname=burrp_sw;charset=utf8', 'burrp_rw', 'Js2g0DwhlqUoIWm', array( PDO::ATTR_PERSISTENT => false)); $stmt1 = $dbh->prepare("SELECT COUNT(1) Total FROM OlaOfferPromoCodes WHERE `Status` = 3"); $stmt1->execute(); $result1 = $stmt1->fetchAll(); global $total; $total = $result1[0]['Total']; $stmt2 =$dbh->prepare("SELECT DATE_FORMAT(DATE(LockedTimeStamp), '%a, %d-%b-%Y') `date`,COUNT(1) `Issued` FROM OlaOfferPromoCodes WHERE `Status` = 3 GROUP BY DATE(LockedTimeStamp) ORDER BY DATE(LockedTimeStamp) DESC"); $stmt2->execute(); global $result2; $result2 = $stmt2->fetchAll(); } ?>
Date | Issued |