Ajout d'une fonction qui liste les livres de l'auteur
This commit is contained in:
parent
6872acde9f
commit
480d4218a8
@ -103,6 +103,41 @@ class Auteur {
|
|||||||
print $this->db->error() . ' in ' . $sql;
|
print $this->db->error() . ' in ' . $sql;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
Function liste_livre()
|
||||||
|
{
|
||||||
|
$ga = array();
|
||||||
|
|
||||||
|
$sql = "SELECT a.rowid, a.title FROM llx_livre as a, llx_livre_to_auteur as l";
|
||||||
|
$sql .= " WHERE a.rowid = l.fk_livre AND l.fk_auteur = ".$this->id;
|
||||||
|
$sql .= " ORDER BY a.title";
|
||||||
|
|
||||||
|
if ($this->db->query($sql) )
|
||||||
|
{
|
||||||
|
$nump = $this->db->num_rows();
|
||||||
|
|
||||||
|
if ($nump)
|
||||||
|
{
|
||||||
|
$i = 0;
|
||||||
|
while ($i < $nump)
|
||||||
|
{
|
||||||
|
$obj = $this->db->fetch_object($i);
|
||||||
|
|
||||||
|
$ga[$obj->rowid] = $obj->title;
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $ga;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $this->db->error();
|
||||||
|
}
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user