Renamed all SQL-related functions to camel-case notation
[mailer.git] / inc / modules / admin / what-list_sponsor_pay.php
index bfdda4c4f7f8c05dfee8eca99cb02c026b2fad47..702388ed31015ac00b5dd46187c9b64b82dc6b6b 100644 (file)
@@ -70,7 +70,7 @@ if (isFormSent('add')) {
                        $id = bigintval($id);
 
                        // Save entry
-                       SQL_QUERY_ESC("UPDATE
+                       sqlQueryEscaped("UPDATE
        `{?_MYSQL_PREFIX?}_sponsor_paytypes`
 SET
        `pay_name`='%s',
@@ -95,7 +95,7 @@ LIMIT 1",
                // Remove entries here...
                foreach (postRequestElement('id') as $id => $sel) {
                        // Remove entry
-                       SQL_QUERY_ESC('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` WHERE `id`=%s LIMIT 1',
+                       sqlQueryEscaped('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` WHERE `id`=%s LIMIT 1',
                                array(bigintval($id)), __FILE__, __LINE__);
                }
 
@@ -111,11 +111,11 @@ LIMIT 1",
 
 if (isFormSent('add')) {
        // Check if entry with same name does exists
-       $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` WHERE `pay_name`='%s' LIMIT 1",
+       $result = sqlQueryEscaped("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` WHERE `pay_name`='%s' LIMIT 1",
                array(postRequestElement('pay_name')), __FILE__, __LINE__);
-       if (SQL_HASZERONUMS($result)) {
+       if (ifSqlHasZeroNums($result)) {
                // No entry found so add this line
-               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_paytypes` (`pay_name`, `pay_rate`, `pay_min_count`, `pay_currency`) VALUES ('%s','%s','%s','%s')",
+               sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_paytypes` (`pay_name`, `pay_rate`, `pay_min_count`, `pay_currency`) VALUES ('%s','%s','%s','%s')",
                        array(
                                postRequestElement('pay_name'),
                                convertCommaToDot(postRequestElement('pay_rate')),
@@ -131,7 +131,7 @@ if (isFormSent('add')) {
        }
 
        // Free memory
-       SQL_FREERESULT($result);
+       sqlFreeResult($result);
 
        // Output message
        displayMessage($message);
@@ -140,11 +140,11 @@ if (isFormSent('add')) {
        $OUT = '';
        foreach (postRequestElement('id') as $id => $sel) {
                // Load entry
-               $result = SQL_QUERY_ESC("SELECT `id`, `pay_name`, `pay_rate`, `pay_min_count`, `pay_currency` FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` WHERE `id`=%s LIMIT 1",
+               $result = sqlQueryEscaped("SELECT `id`, `pay_name`, `pay_rate`, `pay_min_count`, `pay_currency` FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` WHERE `id`=%s LIMIT 1",
                        array(bigintval($id)), __FILE__, __LINE__);
-               if (SQL_NUMROWS($result) == 1) {
+               if (sqlNumRows($result) == 1) {
                        // Load data
-                       $content = SQL_FETCHARRAY($result);
+                       $content = sqlFetchArray($result);
 
                        if (isFormSent('edit')) {
                                // Edit entry
@@ -159,7 +159,7 @@ if (isFormSent('add')) {
                }
 
                // Free result
-               SQL_FREERESULT($result);
+               sqlFreeResult($result);
        } // END - foreach
 
        // Load main template depending on mode (edit/delete)
@@ -172,7 +172,7 @@ if (isFormSent('add')) {
        }
 } else {
        // Load all payment types
-       $result = SQL_QUERY('SELECT
+       $result = sqlQuery('SELECT
        `id`,
        `pay_name`,
        `pay_rate`,
@@ -185,12 +185,12 @@ ORDER BY
                __FILE__, __LINE__);
 
        // Are there some payment types setup?
-       if (!SQL_HASZERONUMS($result)) {
+       if (!ifSqlHasZeroNums($result)) {
                // Prepare variables for listing
                $OUT = '';
 
                // List alle found payment types
-               while ($content = SQL_FETCHARRAY($result)) {
+               while ($content = sqlFetchArray($result)) {
                        // Add row
                        $OUT .= loadTemplate('admin_list_sponsor_pay_row', TRUE, $content);
                } // END - while
@@ -203,7 +203,7 @@ ORDER BY
        }
 
        // Free memory
-       SQL_FREERESULT($result);
+       sqlFreeResult($result);
 
        // Load final template
        loadTemplate('admin_sponsor_paytypes', FALSE, $content);