$OUT = '';
foreach (postRequestParameter('id') as $id => $status) {
// Load data from DB
- $result = SQL_QUERY_ESC("SELECT code, descr FROM `{?_MYSQL_PREFIX?}_countries` WHERE `id`=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `id`, `code`, `descr` FROM `{?_MYSQL_PREFIX?}_countries` WHERE `id`=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Load data
- list($code, $descr) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
-
- // Prepare data, load row template and switch colors
- $content = array(
- 'id' => $id,
- 'code' => $code,
- 'descr' => $descr,
- );
+ $content = SQL_FETCHARRAY($result);
if ($post == 'modify') {
// Generate default selection in edit-mode
// Insert row template and switch color
$OUT .= loadTemplate($row, true, $content);
} // END - if
+
+ // Free result
+ SQL_FREERESULT($result);
} // END - foreach
// Prepare content for template