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,26 +158,33 @@ 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()) { {
$obj = $this->db->fetch_object(0); if ($this->db->num_rows())
{
$obj = $this->db->fetch_object(0);
$this->id = $rowid; $this->id = $rowid;
$this->datep = $obj->dp; $this->datep = $obj->dp;
$this->ref = $obj->ref; $this->ref = $obj->ref;
$this->price = $obj->price; $this->price = $obj->price;
$this->remise = $obj->remise; $this->remise = $obj->remise;
$this->db->free(); $this->db->free();
} }
} else { return 1;
print $this->db->error(); }
else
{
print $this->db->error();
return 0;
}
} }
}
/* /*
* *
* *