]> git.mxchange.org Git - mailer.git/commitdiff
SQL error fixed, query optimized
authorRoland Häder <roland@mxchange.org>
Thu, 5 Nov 2009 14:20:29 +0000 (14:20 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 5 Nov 2009 14:20:29 +0000 (14:20 +0000)
inc/modules/admin/what-config_rallye_prices.php

index 5d7453ff5e25a0a570a8c4ecdad057a8ba5bc050..f21bad00b33d7e39aa4dc7eef2c6c3fbc043c6e0 100644 (file)
@@ -93,14 +93,23 @@ VALUES ('%s','%s','%s','%s')",
                        $id = bigintval($id);
 
                        // Update entry
-                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_rallye_prices` SET rallye_id=%s, price_`level`='%s', points='%s', info='%s' WHERE `id`=%s LIMIT 1",
-                       array(
-                               postRequestElement('rallye_id', $id),
-                               bigintval($level),
-                               postRequestElement('points', $id),
-                               postRequestElement('infos', $id),
-                               $id
-                       ), __FILE__, __LINE__);
+                       SQL_QUERY_ESC("UPDATE
+       `{?_MYSQL_PREFIX?}_rallye_prices`
+SET
+       `rallye_id`=%s,
+       `price_`level``='%s',
+       `points`='%s',
+       `info`='%s'
+WHERE
+       `id`=%s
+LIMIT 1",
+                               array(
+                                       postRequestElement('rallye_id', $id),
+                                       bigintval($level),
+                                       postRequestElement('points', $id),
+                                       postRequestElement('infos', $id),
+                                       $id
+                               ), __FILE__, __LINE__);
                }
 
                // Output message
@@ -124,7 +133,7 @@ VALUES ('%s','%s','%s','%s')",
                                $content = array(
                                        'sw'      => $SW,
                                        'id'      => $id,
-                                       'rallyes' => generateOptionList("rallye_data", 'id', "title", $rallye),
+                                       'rallyes' => generateOptionList('rallye_data', 'id', 'title', $rallye),
                                        'level'   => $level,
                                        'points'  => $points,
                                        'infos'   => $infos,
@@ -154,7 +163,7 @@ VALUES ('%s','%s','%s','%s')",
                        $OUT = ''; $SW = 2;
                        foreach (postRequestElement('sel') as $id => $sel) {
                                // Load data to selected rallye
-                               $result = SQL_QUERY_ESC("SELECT rallye_id, price_level, points, info FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `id`=%s LIMIT 1",
+                               $result = SQL_QUERY_ESC("SELECT `rallye_id`, `price_level`, `points`, `info` FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `id`=%s LIMIT 1",
                                        array(bigintval($id)), __FILE__, __LINE__);
                                list($rallye, $level, $points, $infos) = SQL_FETCHROW($result);
                                SQL_FREERESULT($result);