phpcompta-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpcompta-dev] r4148 - phpcompta/branches/rel560/include


From: phpcompta-dev
Subject: [Phpcompta-dev] r4148 - phpcompta/branches/rel560/include
Date: Tue, 31 May 2011 23:36:30 +0200 (CEST)

Author: danydb
Date: 2011-05-31 23:36:28 +0200 (Tue, 31 May 2011)
New Revision: 4148

Modified:
   phpcompta/branches/rel560/include/class_database.php
Log:
better error message with database::get_value

Modified: phpcompta/branches/rel560/include/class_database.php
===================================================================
--- phpcompta/branches/rel560/include/class_database.php        2011-05-31 
19:27:49 UTC (rev 4147)
+++ phpcompta/branches/rel560/include/class_database.php        2011-05-31 
21:36:28 UTC (rev 4148)
@@ -454,7 +454,12 @@
     {
         $this->ret=$this->exec_sql($p_sql,$p_array);
         if ( pg_NumRows($this->ret) == 0 ) return "";
-        if ( pg_NumRows($this->ret) > 1 ) throw new Exception( "Attention 
$p_sql retourne plusieurs valeurs");
+        if ( pg_NumRows($this->ret) > 1 )
+         {
+           $array=pg_fetch_all($this->ret);
+          throw new Exception( "Attention $p_sql retourne 
".pg_NumRows($this->ret)."  valeurs ".
+                              var_export($p_array,true)." 
values=".var_export($array,true));
+         }
         $r=pg_fetch_row($this->ret,0);
         return $r[0];
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]