Renamed all SQL-related functions to camel-case notation
[mailer.git] / inc / libs / forced_functions.php
index 0f9c80d3818e495a42f41ccddb4c5804fee0874c..1705959c9353480cd4ec253f261aa63ca961bd2c 100644 (file)
@@ -189,11 +189,11 @@ function getArrayFromForcedAdsByType ($forcedType = NULL) {
        // Is forced type not NULL?
        if (!is_null($forcedType)) {
                // Then set proper WHERE
-               $where = sprintf("WHERE `forced_ads_type`='%s'", SQL_ESCAPE($forcedType));
+               $where = sprintf("WHERE `forced_ads_type`='%s'", sqlEscapeString($forcedType));
        } // END - if
 
        // Search all given types
-       $result = SQL_QUERY('SELECT
+       $result = sqlQuery('SELECT
        `forced_ads_id`,
        `forced_ads_ad_url`,
        `forced_ads_click_url`,
@@ -213,16 +213,16 @@ ORDER BY
        `forced_ads_id` ASC', __FUNCTION__, __LINE__);
 
        // Is there at least one entry?
-       if (!SQL_HASZERONUMS($result)) {
+       if (!ifSqlHasZeroNums($result)) {
                // Get all elements
-               while ($content = SQL_FETCHARRAY($result)) {
+               while ($content = sqlFetchArray($result)) {
                        // Add it
                        $forcedAds[$content['forced_ads_id']] = $content;
                } // END - while
        } // END - if
 
        // Free result
-       SQL_FREERESULT($result);
+       sqlFreeResult($result);
 
        // Return it
        return $forcedAds;
@@ -237,11 +237,11 @@ function getArrayFromForcedCostsByVisibility ($visibility = NULL) {
        // Is visibility not NULL?
        if (!is_null($visibility)) {
                // Then add WHERE statement
-               $where = sprintf(" WHERE `forced_costs_visibility`='%s'", SQL_ESCAPE($visibility));
+               $where = sprintf(" WHERE `forced_costs_visibility`='%s'", sqlEscapeString($visibility));
        } // END - if
 
        // Search all given types
-       $result = SQL_QUERY("SELECT
+       $result = sqlQuery("SELECT
        `forced_costs_id`,
        `forced_costs_price_click`,
        `forced_costs_payment_click`,
@@ -253,16 +253,16 @@ ORDER BY
        `forced_costs_id` ASC", __FUNCTION__, __LINE__);
 
        // Is there at least one entry?
-       if (!SQL_HASZERONUMS($result)) {
+       if (!ifSqlHasZeroNums($result)) {
                // Get all elements
-               while ($content = SQL_FETCHARRAY($result)) {
+               while ($content = sqlFetchArray($result)) {
                        // Add it
                        $forcedCosts[$content['forced_costs_id']] = $content;
                } // END - while
        } // END - if
 
        // Free result
-       SQL_FREERESULT($result);
+       sqlFreeResult($result);
 
        // Return it
        return $forcedCosts;
@@ -274,7 +274,7 @@ function getArrayFromForcedCampaignsByArray ($ids, $status) {
        $forcedCampaigns = array();
 
        // Search all given types
-       $result = SQL_QUERY_ESC("SELECT
+       $result = sqlQueryEscaped("SELECT
        `forced_campaign_id`,
        UNIX_TIMESTAMP(`forced_campaign_created`) AS `forced_campaign_created`,
        `forced_campaign_status`,
@@ -301,16 +301,16 @@ ORDER BY
                ), __FUNCTION__, __LINE__);
 
        // Is there at least one entry?
-       if (!SQL_HASZERONUMS($result)) {
+       if (!ifSqlHasZeroNums($result)) {
                // Get all elements
-               while ($content = SQL_FETCHARRAY($result)) {
+               while ($content = sqlFetchArray($result)) {
                        // Add it
                        $forcedCampaigns[$content['forced_campaign_id']] = $content;
                } // END - while
        } // END - if
 
        // Free result
-       SQL_FREERESULT($result);
+       sqlFreeResult($result);
 
        // Return it
        return $forcedCampaigns;
@@ -372,7 +372,7 @@ function changeForcedCampaignStatus ($campaignId, $prevStatus, $newStatus, $data
 
        // Update the status now
        // ---------- Comment out for debugging/developing member actions! ---------
-       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_forced_campaigns` SET `forced_campaign_status`='%s' WHERE `forced_campaign_id`=%s LIMIT 1",
+       sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_forced_campaigns` SET `forced_campaign_status`='%s' WHERE `forced_campaign_id`=%s LIMIT 1",
                array(
                        $newStatus,
                        bigintval($campaignId)
@@ -381,7 +381,7 @@ function changeForcedCampaignStatus ($campaignId, $prevStatus, $newStatus, $data
 
        // Was that fine?
        // ---------- Comment out for debugging/developing member actions! ---------
-       if (SQL_AFFECTEDROWS() != 1) {
+       if (sqlAffectedRows() != 1) {
                // No, something went wrong
                return FALSE;
        } // END - if