summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-11-20 15:36:49 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-11-20 15:36:49 +0000
commit28b86ee456498776e596008ef531b950ec32e7c9 (patch)
treeab444059d1720fbf047dbf1dcffde69ab258c116 /lib
parent8c99cc87702cd47f62e6356be98dc874b051abe9 (diff)
downloadampache-28b86ee456498776e596008ef531b950ec32e7c9.tar.gz
ampache-28b86ee456498776e596008ef531b950ec32e7c9.tar.bz2
ampache-28b86ee456498776e596008ef531b950ec32e7c9.zip
added artist_albums
Diffstat (limited to 'lib')
-rw-r--r--lib/class/artist.class.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/class/artist.class.php b/lib/class/artist.class.php
index 7116d979..552d9645 100644
--- a/lib/class/artist.class.php
+++ b/lib/class/artist.class.php
@@ -94,6 +94,24 @@ class Artist {
} // _get_info
/**
+ * get_from_name
+ * This gets an artist object based on the artist name
+ */
+ public static function get_from_name($name) {
+
+ $name = Dba::escape($name);
+ $sql = "SELECT `id` FROM `artist` WHERE `name`='$name'";
+ $db_results = Dba::query($sql);
+
+ $row = Dba::fetch_assoc($db_results);
+
+ $object = new Artist($row['id']);
+
+ return $object;
+
+ } // get_from_name
+
+ /**
* get_albums
* gets the album ids that this artist is a part
* of