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];
 


_______________________________________________
Phpcompta-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/phpcompta-dev

Reply via email to