Optimize code

This commit is contained in:
Dany De Bontridder 2013-12-03 21:33:05 +00:00
parent ff64c2052b
commit a39c848aef

View file

@ -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 ".