Index: /extensions/event_cats/include/evntcats_admin_funcs.inc.php
===================================================================
--- /extensions/event_cats/include/evntcats_admin_funcs.inc.php	(revision 7116)
+++ /extensions/event_cats/include/evntcats_admin_funcs.inc.php	(revision 7117)
@@ -77,7 +77,5 @@
 function ec_end2($n) {
   global $page;
-  $page['errors'][] =
-   sprintf(l10n('ec_DB_problem'), $n).
-   'MySQL error '.mysql_errno().', "'.mysql_error().'"';
+  my_error(sprintf(l10n('ec_DB_problem'), $n), false);
   return false;
 }
@@ -151,8 +149,6 @@
      $page['infos'][] =
       sprintf(l10n('ec_group_create_OK'), $_POST['groupname']);
-    if (!$t3)
-     $page['errors'][] =
-      sprintf(l10n('ec_group_create_pb'), $_POST['groupname']).' (1) : '.
-      'MySQL error '.mysql_errno().', "'.mysql_error().'"';
+    if (!$t3) my_error(sprintf(l10n('ec_group_create_pb'),
+                               $_POST['groupname']).' (1) ', false);
     if (
       pwg_query("
@@ -160,7 +156,6 @@
         VALUES ('".$ec_user_id."', '".$t3[0]."');
       ") === false
-    ) $page['errors'][] =
-      sprintf(l10n('ec_group_create_pb'), $_POST['groupname']).' (2) : '.
-      'MySQL error '.mysql_errno().', "'.mysql_error().'"';
+    ) my_error(sprintf(l10n('ec_group_create_pb'),
+                       $_POST['groupname']).' (2) ', false);
     else $page['infos'][] = sprintf(
       l10n('ec_group_create_OK2'),
@@ -202,9 +197,8 @@
            $_POST['groupname'],$ec_lists['categories'][$_POST['ec_in_up_cat']]
          );
-        else
-         $page['errors'][] = sprintf(
+        else my_error(sprintf(
           l10n('ec_assoc_pb'),
-          $_POST['groupname'],$ec_lists['categories'][$_POST['ec_in_up_cat']]
-         ).' : MySQL error '.mysql_errno().', "'.mysql_error().'"';
+          $_POST['groupname'], $ec_lists['categories'][$_POST['ec_in_up_cat']]
+        ), false);
       }
     }
@@ -237,9 +231,8 @@
             SET `title` = '".implode('/user_id=', $t_user)."'
             WHERE `id` = ".$_POST['ec_in_up_aps'].";
-        ") === false)
-         $page['errors'][] = sprintf(
+        ") === false) my_error(sprintf(
           l10n('ec_assoc_pb'),
-          $_POST['groupname'],$ec_lists['add_pages'][$_POST['ec_in_up_aps']]
-         ).' : MySQL error '.mysql_errno().', "'.mysql_error().'"';
+          $_POST['groupname'], $ec_lists['add_pages'][$_POST['ec_in_up_aps']]
+        ), false);
         else $page['infos'][] = sprintf(
          l10n('ec_group_create_OK2'),
@@ -290,9 +283,8 @@
            $_POST['login'], $ec_lists['categories'][$_POST['ec_in_up_cat']]
          );
-        else
-         $page['errors'][] = sprintf(
+        else my_error(sprintf(
           l10n('ec_assoc_pb'),
           $_POST['login'], $ec_lists['categories'][$_POST['ec_in_up_cat']]
-         ).' : MySQL error '.mysql_errno().', "'.mysql_error().'"';
+        ), false);
       }
     }
@@ -607,15 +599,13 @@
       ") === false
     ) {
-      $page['errors'][] =
-       l10n('ec_entry_create_pb').' : '.
-       'MySQL error '.mysql_errno().', "'.mysql_error().'"'
-      ;
+      my_error(l10n('ec_entry_create_pb'), false);
       $ret = false;
     }
     else {
+      $t5 = pwg_db_insert_id(EVNTCATS_TABLE);
       build_ec_lists(); // Don't remember exactly why, but must be done here
       $forced = ($forced == 'false') ? '' : l10n('ec_cnfrm_forced');
       $page['infos'][] =
-       sprintf(l10n('ec_entry_create_OK'), pwg_db_insert_id()).
+       sprintf(l10n('ec_entry_create_OK'), $t5).
        $ec_code.' => '.
        $ec_lists['user_ids'][$ec_user_id].$forced
@@ -638,8 +628,5 @@
       ") === false
     ) {
-      $page['errors'][] =
-       l10n('ec_entry_create_pb').' : '.
-       'MySQL error '.mysql_errno().', "'.mysql_error().'"'
-      ;
+      my_error(l10n('ec_entry_create_pb'), false);
       $ret = false;
     }
@@ -675,8 +662,5 @@
     WHERE `id` = ".$ec_id
   ) === false) {
-    $page['errors'][] =
-     sprintf(l10n('ec_entry_del_nok'),
-     $ec_id).
-     'MySQL error '.mysql_errno().', "'.mysql_error().'"';
+    my_error(sprintf(l10n('ec_entry_del_nok'), $ec_id), false);
     return false;
   }
