We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 50994684 authored by jurgbohn's avatar jurgbohn

reportError if query fails

parent b455c2cc
......@@ -75,9 +75,11 @@ class Album {
function getPlayCount() {
global $mdb2;
$res = $mdb2->query("SELECT COUNT(*) AS scrobbles FROM Scrobbles JOIN Track ON Scrobbles.track = Track.name WHERE Scrobbles.artist = "
. $mdb2->quote($this->artist_name, 'text') . 'AND Track.album ='
. $mdb2->quote($this->artist_name, 'text') . ' AND Track.album ='
. $mdb2->quote($this->name, 'text'));
if(PEAR::isError($res) || !$res->numRows()) {
if(PEAR::isError($res)) {
reportError($res->getMessage(), $res->getUserInfo());
} else if (!$res->numRows()) {
$c = 0;
} else {
$row = sanitize($res->fetchRow(MDB2_FETCHMODE_ASSOC));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment