Some fixes, surfbar fixed reload is now in select boxes
[mailer.git] / inc / modules / admin / admin-inc.php
index ea7df656eade12a540ad1832e9b528b8ed1ad0b0..d6b6c0b65e459e6ebcd88095304250e1d8cadc58 100644 (file)
@@ -656,10 +656,10 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName="_config", $whereStatement="con
                                $test = (float)$val;
                                if ("".$val."" == "".$test."") {
                                        // Add numbers
-                                       $DATA[] = $id."=".$val."";
+                                       $DATA[] = sprintf("`%s`=%s%s", $id, $test);
                                } else {
                                        // Add strings
-                                       $DATA[] = $id."='".trim($val)."'";
+                                       $DATA[] = sprintf("`%s`='%s'", $id, trim($val));
                                }
 
                                // Update current configuration
@@ -672,9 +672,9 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName="_config", $whereStatement="con
        $result = false;
        if (!$alwaysAdd) {
                if (!empty($whereStatement)) {
-                       $result = SQL_QUERY("SELECT * FROM "._MYSQL_PREFIX.$tableName." WHERE ".$whereStatement." LIMIT 1", __FILE__, __LINE__);
+                       $result = SQL_QUERY("SELECT * FROM `"._MYSQL_PREFIX.$tableName."` WHERE ".$whereStatement." LIMIT 1", __FILE__, __LINE__);
                } else {
-                       $result = SQL_QUERY("SELECT * FROM "._MYSQL_PREFIX.$tableName." LIMIT 1", __FILE__, __LINE__);
+                       $result = SQL_QUERY("SELECT * FROM `"._MYSQL_PREFIX.$tableName."` LIMIT 1", __FILE__, __LINE__);
                }
        } // END - if
 
@@ -683,7 +683,11 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName="_config", $whereStatement="con
                $DATA_UPDATE = implode(", ", $DATA);
 
                // Generate SQL string
-               $SQL = "UPDATE "._MYSQL_PREFIX.$tableName." SET ".$DATA_UPDATE." WHERE ".$whereStatement." LIMIT 1";
+               $SQL = sprintf("UPDATE `"._MYSQL_PREFIX."%s` SET %s WHERE %s LIMIT 1",
+                       $tableName,
+                       $DATA_UPDATE,
+                       $whereStatement
+               );
        } else {
                // Add Line (does only work with auto_increment!
                $KEYs = array(); $VALUEs = array();
@@ -698,7 +702,11 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName="_config", $whereStatement="con
                $VALUEs = implode(", ", $VALUEs);
 
                // Generate SQL string
-               $SQL = "INSERT INTO "._MYSQL_PREFIX.$tableName." (".$KEYs.") VALUES (".$VALUEs.")";
+               $SQL = sprintf("INSERT INTO "._MYSQL_PREFIX."%s (%s) VALUES (%s)",
+                       $tableName,
+                       $KEYs,
+                       $VALUEs
+               );
        }
 
        // Free memory