summaryrefslogtreecommitdiffstats
path: root/lib/class/genre.class.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/class/genre.class.php')
-rw-r--r--lib/class/genre.class.php27
1 files changed, 25 insertions, 2 deletions
diff --git a/lib/class/genre.class.php b/lib/class/genre.class.php
index 9d5e4d4e..a0e5b240 100644
--- a/lib/class/genre.class.php
+++ b/lib/class/genre.class.php
@@ -35,10 +35,33 @@ class Genre {
* @package Genre
* @catagory Constructor
*/
- function Genre() {
+ function Genre($genre_id=0) {
+ if ($genre_id > 0) {
+ $this->id = $genre_id;
+ $info = $this->_get_info();
+ $this->name = $info['name'];
+ }
- } // genre
+
+ } // Genre
+
+ /**
+ * Private Get Info
+ * This simply returns the information for this genre
+ * @package Genre
+ * @catagory Class
+ */
+ function _get_info() {
+
+ $sql = "SELECT * FROM " . tbl_name('genre') . " WHERE id='$this->id'";
+ $db_results = mysql_query($sql, dbh());
+
+ $results = mysql_fetch_assoc($db_results);
+
+ return $results;
+
+ } // _get_info()
} //end of genre class