database::get_value throw an exception if there are too many rows

This commit is contained in:
Dany De Bontridder 2010-04-25 18:28:44 +00:00
parent 9cc6736dae
commit 9da64aeb56

View file

@ -391,7 +391,7 @@ de données");
{
$this->ret=$this->exec_sql($p_sql,$p_array);
if ( pg_NumRows($this->ret) == 0 ) return "";
if ( pg_NumRows($this->ret) > 1 ) echo "Attention $p_sql retourne plusieurs valeurs";
if ( pg_NumRows($this->ret) > 1 ) throw new Exception( "Attention $p_sql retourne plusieurs valeurs");
$r=pg_fetch_row($this->ret,0);
return $r[0];