From: Roland Häder Date: Wed, 17 Sep 2008 11:41:08 +0000 (+0000) Subject: Magic constants removed from db layer X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=commitdiff_plain;h=13c15f245f4635042918d1986a89910b676aae04 Magic constants removed from db layer --- diff --git a/inc/databases.php b/inc/databases.php index 1fd899b609..d8b460b86d 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -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); diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php index 0109f4e0e4..9b42362a0f 100644 --- a/inc/db/lib-mysql3.php +++ b/inc/db/lib-mysql3.php @@ -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) { diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index ebf2b0e3ca..e386039365 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -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) { diff --git a/inc/modules/admin/what-config_home.php b/inc/modules/admin/what-config_home.php index c2068f9ffb..e4b640b21e 100644 --- a/inc/modules/admin/what-config_home.php +++ b/inc/modules/admin/what-config_home.php @@ -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))