ajout code retour dans fetch

This commit is contained in:
Rodolphe Quiedeville 2003-06-30 14:56:46 +00:00
parent ab1d0aefe6
commit 65daba6e03

View File

@ -129,20 +129,21 @@ class Societe {
* *
* *
*/ */
Function fetch($socid) { Function fetch($socid)
{
$this->id = $socid; $this->id = $socid;
$sql = "SELECT s.idp, s.nom, s.address,".$this->db->pdate("s.datec")." as dc,"; $sql = "SELECT s.idp, s.nom, s.address,".$this->db->pdate("s.datec")." as dc,";
$sql .= " s.tel, s.fax, s.url,s.cp,s.ville, s.note, s.siren, client, fournisseur"; $sql .= " s.tel, s.fax, s.url,s.cp,s.ville, s.note, s.siren, client, fournisseur";
$sql .= " FROM llx_societe as s"; $sql .= " FROM llx_societe as s";
$sql .= " WHERE s.idp = ".$this->id; $sql .= " WHERE s.idp = ".$this->id;
$result = $this->db->query($sql); $result = $this->db->query($sql);
if ($result) { if ($result)
if ($this->db->num_rows()) { {
if ($this->db->num_rows())
{
$obj = $this->db->fetch_object(0); $obj = $this->db->fetch_object(0);
$this->nom = stripslashes($obj->nom); $this->nom = stripslashes($obj->nom);
@ -161,9 +162,13 @@ class Societe {
$this->note = $obj->note; $this->note = $obj->note;
return 1;
} }
$this->db->free(); $this->db->free();
} else { }
else
{
print $this->db->error(); print $this->db->error();
} }
} }