Renamed all SQL-related functions to camel-case notation
[mailer.git] / inc / libs / register_functions.php
index 2b2f0c08c455c4a09cb5a1ed444239ff2d0a6c15..94826655e798ffb00230aee4882da57763f91239 100644 (file)
@@ -46,11 +46,11 @@ function ifRequiredRegisterFieldsAreSet (&$array) {
        $ret = TRUE;
        foreach ($array as $key => $value) {
                // Check all fields that must register
-               $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_must_register` WHERE `field_name`='%s' AND `field_required`='Y' LIMIT 1",
+               $result = sqlQueryEscaped("SELECT `id` FROM `{?_MYSQL_PREFIX?}_must_register` WHERE `field_name`='%s' AND `field_required`='Y' LIMIT 1",
                        array($key), __FUNCTION__, __LINE__);
 
                // Entry found?
-               if (SQL_NUMROWS($result) == 1) {
+               if (sqlNumRows($result) == 1) {
                        // Check if extension country is not found (you have to enter the 2-chars long country code) or
                        // if extensions is present check if country code was selected
                        //         01              2         21    12             3         32    234     5      54    4               43    34                      4    4      5      5432    2      3                      3210
@@ -63,7 +63,7 @@ function ifRequiredRegisterFieldsAreSet (&$array) {
                } // END - if
 
                // Free result
-               SQL_FREERESULT($result);
+               sqlFreeResult($result);
        } // END - foreach
 
        // Return result
@@ -87,7 +87,7 @@ function registerGenerateCategoryTable ($mode, $configEntry = 'register_default'
        } // END - if
 
        // Look for categories
-       $result = SQL_QUERY('SELECT
+       $result = sqlQuery('SELECT
        `id`,
        `cat`,
        `visible`
@@ -98,10 +98,10 @@ ORDER BY
        `sort` ASC',
                __FUNCTION__, __LINE__);
 
-       if (!SQL_HASZERONUMS($result)) {
+       if (!ifSqlHasZeroNums($result)) {
                // List alle visible modules (or all to the admin)
                $OUT .= '<table border="0" cellspacing="0" cellpadding="0" width="100%">';
-               while ($content = SQL_FETCHARRAY($result)) {
+               while ($content = sqlFetchArray($result)) {
                        // Prepare array for the template
                        $content['default_yes'] = '';
                        $content['default_no']  = '';
@@ -119,7 +119,7 @@ ORDER BY
                $OUT .= '</table>';
 
                // Free memory
-               SQL_FREERESULT($result);
+               sqlFreeResult($result);
        } else {
                // No categories setted up so far...
                $OUT .= displayMessage('{--NO_CATEGORIES_VISIBLE--}', TRUE);
@@ -312,7 +312,7 @@ function doUserRegistration () {
        } // END - if
 
        // Create user's account...
-       SQL_QUERY_ESC("INSERT INTO
+       sqlQueryEscaped("INSERT INTO
        `{?_MYSQL_PREFIX?}_user_data`
 (
        `gender`,
@@ -383,7 +383,7 @@ function doUserRegistration () {
        ), __FUNCTION__, __LINE__);
 
        // Get his userid
-       $filterData['register_insert_id'] = SQL_INSERT_ID();
+       $filterData['register_insert_id'] = getSqlInsertId();
 
        // Did this work?
        if (!isValidId($filterData['register_insert_id'])) {
@@ -397,7 +397,7 @@ function doUserRegistration () {
        // Shall we reset random refid? Only possible with latest ext-user
        if (isExtensionInstalledAndNewer('user', '0.3.4')) {
                // Reset all accounts, registration is done
-               SQL_QUERY('UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `rand_confirmed`=0', __FUNCTION__, __LINE__);
+               sqlQuery('UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `rand_confirmed`=0', __FUNCTION__, __LINE__);
        } // END - if
 
        // Update referral table
@@ -431,7 +431,7 @@ function doUserRegistration () {
                } // END - foreach
 
                // Run SQL without last commata
-               SQL_QUERY(substr($sql, 0, -1), __FUNCTION__, __LINE__);
+               sqlQuery(substr($sql, 0, -1), __FUNCTION__, __LINE__);
        } // END - if
 
        // Registration phase is done here, so for tester accounts we end here
@@ -451,32 +451,32 @@ function doUserRegistration () {
                $content = array(
                        'hash'     => $GLOBALS['register_confirm_hash'],
                        'userid'   => $filterData['register_insert_id'],
-                       'gender'   => SQL_ESCAPE(postRequestElement('gender')),
-                       'surname'  => SQL_ESCAPE(postRequestElement('surname')),
-                       'family'   => SQL_ESCAPE(postRequestElement('family')),
-                       'email'    => SQL_ESCAPE(postRequestElement('email')),
-                       'street'   => SQL_ESCAPE(postRequestElement('street_nr')),
-                       'city'     => SQL_ESCAPE(postRequestElement('city')),
+                       'gender'   => sqlEscapeString(postRequestElement('gender')),
+                       'surname'  => sqlEscapeString(postRequestElement('surname')),
+                       'family'   => sqlEscapeString(postRequestElement('family')),
+                       'email'    => sqlEscapeString(postRequestElement('email')),
+                       'street'   => sqlEscapeString(postRequestElement('street_nr')),
+                       'city'     => sqlEscapeString(postRequestElement('city')),
                        'zip'      => bigintval(postRequestElement('zip')),
                        'country'  => $GLOBALS['register_country_data'],
-                       'refid'    => SQL_ESCAPE(postRequestElement('refid')),
-                       'password' => SQL_ESCAPE(postRequestElement('password1')),
+                       'refid'    => sqlEscapeString(postRequestElement('refid')),
+                       'password' => sqlEscapeString(postRequestElement('password1')),
                );
        } else {
                // No ZIP code entered
                $content = array(
                        'hash'     => $GLOBALS['register_confirm_hash'],
                        'userid'   => $filterData['register_insert_id'],
-                       'gender'   => SQL_ESCAPE(postRequestElement('gender')),
-                       'surname'  => SQL_ESCAPE(postRequestElement('surname')),
-                       'family'   => SQL_ESCAPE(postRequestElement('family')),
-                       'email'    => SQL_ESCAPE(postRequestElement('email')),
-                       'street'   => SQL_ESCAPE(postRequestElement('street_nr')),
-                       'city'     => SQL_ESCAPE(postRequestElement('city')),
+                       'gender'   => sqlEscapeString(postRequestElement('gender')),
+                       'surname'  => sqlEscapeString(postRequestElement('surname')),
+                       'family'   => sqlEscapeString(postRequestElement('family')),
+                       'email'    => sqlEscapeString(postRequestElement('email')),
+                       'street'   => sqlEscapeString(postRequestElement('street_nr')),
+                       'city'     => sqlEscapeString(postRequestElement('city')),
                        'zip'      => '',
                        'country'  => $GLOBALS['register_country_data'],
-                       'refid'    => SQL_ESCAPE(postRequestElement('refid')),
-                       'password' => SQL_ESCAPE(postRequestElement('password1')),
+                       'refid'    => sqlEscapeString(postRequestElement('refid')),
+                       'password' => sqlEscapeString(postRequestElement('password1')),
                );
        }