Ajout d'un code retour dans ->fetch

This commit is contained in:
Rodolphe Quiedeville 2003-06-19 12:46:38 +00:00
parent dbe94561ca
commit 7c528e0f40

View File

@ -158,12 +158,15 @@ class Propal {
* *
* *
*/ */
Function fetch($rowid) { Function fetch($rowid)
{
$sql = "SELECT ref,price,remise,".$this->db->pdate(datep)."as dp FROM llx_propal WHERE rowid=$rowid;"; $sql = "SELECT ref,price,remise,".$this->db->pdate(datep)."as dp FROM llx_propal WHERE rowid=$rowid;";
if ($this->db->query($sql) ) { if ($this->db->query($sql) )
if ($this->db->num_rows()) { {
if ($this->db->num_rows())
{
$obj = $this->db->fetch_object(0); $obj = $this->db->fetch_object(0);
$this->id = $rowid; $this->id = $rowid;
@ -174,8 +177,12 @@ class Propal {
$this->db->free(); $this->db->free();
} }
} else { return 1;
}
else
{
print $this->db->error(); print $this->db->error();
return 0;
} }
} }
/* /*