From a39c848aef4817a71cbf1c04c7bcf94beed1c03e Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Tue, 3 Dec 2013 21:33:05 +0000 Subject: [PATCH] Optimize code --- include/class_database.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/class_database.php b/include/class_database.php index 2b974bb33..f0d8c69e7 100644 --- a/include/class_database.php +++ b/include/class_database.php @@ -498,8 +498,9 @@ class Database function get_value($p_sql,$p_array=null) { $this->ret=$this->exec_sql($p_sql,$p_array); - if ( pg_NumRows($this->ret) == 0 ) return ""; - if ( pg_NumRows($this->ret) > 1 ) + $r= pg_NumRows($this->ret); + if ( $r == 0 ) return ""; + if ( $r > 1 ) { $array=pg_fetch_all($this->ret); throw new Exception( "Attention $p_sql retourne ".pg_NumRows($this->ret)." valeurs ".