librefm-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Librefm-commits] [1230] reportError if query fails


From: Jørgen Bøhnsdalen
Subject: [Librefm-commits] [1230] reportError if query fails
Date: Wed, 06 May 2009 18:13:16 +0000

Revision: 1230
          http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1230
Author:   jurgbohn
Date:     2009-05-06 18:13:16 +0000 (Wed, 06 May 2009)
Log Message:
-----------
reportError if query fails

Modified Paths:
--------------
    trunk/nixtape/data/Album.php

Modified: trunk/nixtape/data/Album.php
===================================================================
--- trunk/nixtape/data/Album.php        2009-05-06 18:07:06 UTC (rev 1229)
+++ trunk/nixtape/data/Album.php        2009-05-06 18:13:16 UTC (rev 1230)
@@ -75,9 +75,11 @@
        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));





reply via email to

[Prev in Thread] Current Thread [Next in Thread]