Magic constants removed from db layer
authorRoland Häder <roland@mxchange.org>
Wed, 17 Sep 2008 11:41:08 +0000 (11:41 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 17 Sep 2008 11:41:08 +0000 (11:41 +0000)
inc/databases.php
inc/db/lib-mysql3.php
inc/modules/admin/admin-inc.php
inc/modules/admin/what-config_home.php

index 1fd899b609a3a2be9a2f6c0d0673b992665ee7ea..d8b460b86dfca8b9425bfa24e13dc5511b6ce2b4 100644 (file)
@@ -113,7 +113,7 @@ define('USAGE_BASE', "usage");
 define('SERVER_URL', "http://www.mxchange.org");
 
 // This current patch level
-define('CURR_SVN_REVISION', "348");
+define('CURR_SVN_REVISION', "349");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index 0109f4e0e45645683dfe646176ea4198516039c0..9b42362a0f5336f7dfcd4e764992e4bdb85114d1 100644 (file)
@@ -284,12 +284,12 @@ function SQL_ESCAPE($str, $secureString = true) {
        }
 }
 // SELECT query string from table, columns and so on... ;-)
-function SQL_RESULT_FROM_ARRAY ($table, $columns, $idRow, $id) {
+function SQL_RESULT_FROM_ARRAY ($table, $columns, $idRow, $id, $F, $L) {
        // Prepare the SQL statement
        $SQL = "SELECT ".implode(", ", $columns)." FROM "._MYSQL_PREFIX."_".$table." WHERE ".$idRow."=%s LIMIT 1";
 
        // Return the result
-       return SQL_QUERY_ESC($SQL, array(bigintval($id)), __FILE__, __LINE__);
+       return SQL_QUERY_ESC($SQL, array(bigintval($id)), $F, $L);
 }
 // ALTER TABLE wrapper function
 function SQL_ALTER_TABLE($sql, $F, $L) {
@@ -304,7 +304,7 @@ function SQL_ALTER_TABLE($sql, $F, $L) {
 
                // Get column information
                $result = SQL_QUERY_ESC("SHOW COLUMNS FROM %s LIKE '%s'",
-                       array($tableName, $columnName), __FILE__, __LINE__);
+                       array($tableName, $columnName), $F, $L);
 
                // Do we have no entry?
                if (SQL_NUMROWS($result) == 0) {
index ebf2b0e3caba251d4c141eed40166ac957c60b57..e386039365eb9ed0c5e48518ed605dfd6657e1b7 100644 (file)
@@ -903,7 +903,7 @@ function ADMIN_BUILD_LIST ($listType, $IDs, $table, $columns, $filterFunctions,
                $id = bigintval($id);
 
                // Get result from a given column array and table name
-               $result = SQL_RESULT_FROM_ARRAY($table, $columns, $idColumn, $id);
+               $result = SQL_RESULT_FROM_ARRAY($table, $columns, $idColumn, $id, __FILE__, __LINE__);
 
                // Is there one entry?
                if (SQL_NUMROWS($result) == 1) {
index c2068f9ffb6c8476a5467a9f41bd4b32bb1d6b2b..e4b640b21e42708d522847d5b8dca851b0e28365 100644 (file)
@@ -76,9 +76,9 @@ case "target": // Set which what-file will be placed in home-page (only modules.
 
        // Load all what menu points
        $result = SQL_QUERY("SELECT id, what, title
- FROM "._MYSQL_PREFIX."_guest_menu
- WHERE action='main' AND what != '' AND what IS NOT NULL AND locked='N'
- ORDER BY sort", __FILE__, __LINE__);
+FROM "._MYSQL_PREFIX."_guest_menu
+WHERE action='main' AND what != '' AND what IS NOT NULL AND locked='N'
+ORDER BY sort ASC", __FILE__, __LINE__);
 
        $SW = 2; $OUT = ""; $atitle = "";
        while (list($id, $wht, $wtitle) = SQL_FETCHROW($result))