if (isGetRequestElementSet('coupon_id')) {
// List userids for given coupon
- $result = SQL_QUERY_ESC('SELECT
+ $result = sqlQueryEscaped('SELECT
`u`.`coupon_id`,
`u`.`userid`,
UNIX_TIMESTAMP(`u`.`cashed_on`) AS `cashed_on`,
), __FILE__, __LINE__);
// Are there entries?
- if (!SQL_HASZERONUMS($result)) {
+ if (!ifSqlHasZeroNums($result)) {
// Init variable
$OUT = '';
// Load all rows
- while ($content = SQL_FETCHARRAY($result)) {
+ while ($content = sqlFetchArray($result)) {
// Translate all timestamps
$content['cashed_on'] = generateDateTime($content['cashed_on'] , '2');
$content['coupon_created'] = generateDateTime($content['coupon_created'], '2');
}
// Free result
- SQL_FREERESULT($result);
+ sqlFreeResult($result);
} else {
// Check if the user has cashed coupons
- $result = SQL_QUERY('SELECT
+ $result = sqlQuery('SELECT
`d`.`id` AS `coupon_id`,
UNIX_TIMESTAMP(`d`.`coupon_created`) AS `coupon_created`,
UNIX_TIMESTAMP(`d`.`coupon_expired`) AS `coupon_expired`,
`d`.`id` ASC', __FILE__, __LINE__);
// Are there entries?
- if (!SQL_HASZERONUMS($result)) {
+ if (!ifSqlHasZeroNums($result)) {
// Init variable
$OUT = '';
// Load all rows
- while ($content = SQL_FETCHARRAY($result)) {
+ while ($content = sqlFetchArray($result)) {
// Translate all timestamps
$content['coupon_created'] = generateDateTime($content['coupon_created'], '2');
$content['coupon_expired'] = generateDateTime($content['coupon_expired'], '2');
}
// Free result
- SQL_FREERESULT($result);
+ sqlFreeResult($result);
}
// [EOF]