X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_country.php;h=1525b03830f3bf709bc5788144f1e25aee63d437;hb=29157685184b9aa2ddbf42e9d2e49141af95f7e2;hp=fe0e6b9ee7d0e9265389e724ce57c4499c2a144c;hpb=cf3765c38cf0a76f396aca291f71858936e92956;p=mailer.git diff --git a/inc/modules/admin/what-list_country.php b/inc/modules/admin/what-list_country.php index fe0e6b9ee7..1525b03830 100644 --- a/inc/modules/admin/what-list_country.php +++ b/inc/modules/admin/what-list_country.php @@ -104,19 +104,11 @@ if ((isFormSent('add')) && (isPostRequestParameterSet('code')) && (isPostRequest $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 @@ -129,6 +121,9 @@ if ((isFormSent('add')) && (isPostRequestParameterSet('code')) && (isPostRequest // Insert row template and switch color $OUT .= loadTemplate($row, true, $content); } // END - if + + // Free result + SQL_FREERESULT($result); } // END - foreach // Prepare content for template @@ -170,12 +165,12 @@ if ((isFormSent('add')) && (isPostRequestParameterSet('code')) && (isPostRequest // Display message loadTemplate('admin_settings_saved', false, $message); - } + } // END - if // Load currenty setup country codes to list $result = SQL_QUERY('SELECT id, code, descr, is_active FROM `{?_MYSQL_PREFIX?}_countries` ORDER BY code', __FILE__, __LINE__); - if (SQL_NUMROWS($result) > 0) { + if (!SQL_HASZERONUMS($result)) { // List all countries $OUT = ''; while ($content = SQL_FETCHARRAY($result)) {