Subversion-Projekte lars-tiefland.medien

Revision

Revision 10 | Zur aktuellen Revision | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

<?
        Class Album
        {
                var $id;
                var $name;
                var $pic;
                var $year;

                function __construct($id=0)
                {
                        global $db, $prefix;
                        if ($id)
                        {
                                $sql="SELECT * FROM $prefix"."albums WHERE a_id=$id";
                                $res=$db->query($sql);
                                $row=$res->fetchRow();
                                $this->name=$row["a_name"];
                                $this->year=$row["a_year"];
                                $this->pic =$row["a_pic"];
                        }
                        else
                        {
                                $this->name="";
                                $this->pic="";
                                $this->year=0;
                        }
                        return $this;
                }
                function Album($id)
                {
                        $this->__construct($id);
                }

        }
?>