]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-admin_add.php
Renamed all SQL-related functions to camel-case notation
[mailer.git] / inc / modules / admin / what-admin_add.php
index eaae702d3dfa8cb2b46993b838ac5c13ded5c8f5..e4baa04123417350309e6557b2f4b3d3b950eaf4 100644 (file)
@@ -55,11 +55,11 @@ if (!isFormSent()) {
        $below = array();
 
        // Get all available main menus
-       $result = SQL_QUERY("SELECT `action`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort` ASC", __FILE__, __LINE__);
-       if (!SQL_HASZERONUMS($result)) {
+       $result = sqlQuery("SELECT `action`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort` ASC", __FILE__, __LINE__);
+       if (!ifSqlHasZeroNums($result)) {
                // Read menu structure
                // @TODO Cant this be rewritten?
-               while ($content = SQL_FETCHARRAY($result)) {
+               while ($content = sqlFetchArray($result)) {
                        // Menu actions
                        array_push($menus, $content['action']);
 
@@ -71,7 +71,7 @@ if (!isFormSent()) {
                } // END - while
 
                // Free memory
-               SQL_FREERESULT($result);
+               sqlFreeResult($result);
 
                // Remove double eintries
                // @TODO This can be somehow rewritten to a function
@@ -93,16 +93,16 @@ if (!isFormSent()) {
 
                // Load sub menus :)
                foreach ($menus as $key_main => $value_main) {
-                       $result = SQL_QUERY_ESC("SELECT `what`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort` ASC",
+                       $result = sqlQueryEscaped("SELECT `what`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort` ASC",
                                array($value_main), __FILE__, __LINE__);
-                       if (!SQL_HASZERONUMS($result)) {
+                       if (!ifSqlHasZeroNums($result)) {
                                // Init arrays
                                $menus[$value_main] = array();
                                $titles[$value_main] = array();
                                $below[$value_main] = array();
 
                                // Read menu structure
-                               while ($content = SQL_FETCHARRAY($result)) {
+                               while ($content = sqlFetchArray($result)) {
                                        // Menu actions
                                        array_push($menus[$value_main], $content['what']);
 
@@ -114,7 +114,7 @@ if (!isFormSent()) {
                                } // END - while
 
                                // Free memory
-                               SQL_FREERESULT($result);
+                               sqlFreeResult($result);
 
                                // Remove double eintries
                                // @TODO This can be somehow rewritten to a function
@@ -165,7 +165,7 @@ if (!isFormSent()) {
        // Insert new menu entry
        if (isPostRequestElementSet('menu')) {
                // Add sub menu
-               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`, `what`, `title`, `descr`, `sort`) VALUES ('%s','%s','%s','%s','%s')",
+               sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`, `what`, `title`, `descr`, `sort`) VALUES ('%s','%s','%s','%s','%s')",
                        array(
                                postRequestElement('menu'),
                                postRequestElement('name'),
@@ -176,7 +176,7 @@ if (!isFormSent()) {
                );
        } else {
                // Add main menu
-               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (action, title, descr, sort) VALUES ('%s','%s','%s','%s')",
+               sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (action, title, descr, sort) VALUES ('%s','%s','%s','%s')",
                        array(
                                postRequestElement('name'),
                                postRequestElement('title'),