// Insert member earning entry
function insertMemberEarning ($earningId, $dailyAmount, $isActive = 'Y') {
// Insert the record
- SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_earning` (`earning_id`, `earning_userid`, `earning_daily_amount`, `earning_active`) VALUES(%s,%s,%s,'%s')",
+ sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_user_earning` (`earning_id`, `earning_userid`, `earning_daily_amount`, `earning_active`) VALUES(%s,%s,%s,'%s')",
array(
bigintval($earningId),
getMemberId(),
// Prepare content
$content = array(
- 'insert_id' => SQL_INSERT_ID(),
+ 'insert_id' => getSqlInsertId(),
'earning_id' => bigintval($earningId),
'daily_amount' => bigintval($dailyAmount),
'is_active' => $isActive
sendAdminNotification('{--ADMIN_EARNING_INSERTED_SUBJECT--}', 'admin_earning_added', $content, getMemberId());
// Return status
- return ($content['insert_id'] > 0);
+ return isValidId($content['insert_id']);
}
// Update a given earning amount
} // END - if
// Update database record
- SQL_QUERY_ESC("UPDATE
+ sqlQueryEscaped("UPDATE
`{?_MYSQL_PREFIX?}_user_earning`
SET
`earning_daily_amount`=%s,
), __FUNCTION__, __LINE__);
// Determine whether something has changed
- $status = (!SQL_HASZEROAFFECTED());
+ $status = (!ifSqlHasZeroAffectedRows());
// Has the record changed?
if ($status === TRUE) {