librefm-commits
[Top][All Lists]
Advanced

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

[Librefm-commits] [1501] handle exception in display.php


From: Clint Adams
Subject: [Librefm-commits] [1501] handle exception in display.php
Date: Tue, 12 May 2009 00:25:48 +0000

Revision: 1501
          http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1501
Author:   clint
Date:     2009-05-12 00:25:48 +0000 (Tue, 12 May 2009)
Log Message:
-----------
handle exception in display.php

Modified Paths:
--------------
    trunk/gnukebox/display.php

Modified: trunk/gnukebox/display.php
===================================================================
--- trunk/gnukebox/display.php  2009-05-12 00:19:49 UTC (rev 1500)
+++ trunk/gnukebox/display.php  2009-05-12 00:25:48 UTC (rev 1501)
@@ -62,6 +62,7 @@
 
                $adodb->SetFetchMode(ADODB_FETCH_ASSOC);
 
+               try {
 if ($req_user) {
 //                     echo "SELECT username, artist, track, time FROM 
Scrobbles WHERE username = '" . $adodb->qstr($req_user) . "' ORDER BY time DESC 
LIMIT 100";
                        $res = $adodb->CacheGetAll(60, "SELECT username, 
artist, track, time FROM Scrobbles WHERE username = " . $adodb->qstr($req_user) 
. " ORDER BY time DESC LIMIT 100");
@@ -84,6 +85,7 @@
                        $res = $adodb->CacheGetAll(60, "SELECT username, 
artist, track, time FROM Scrobbles ORDER BY time DESC LIMIT 10");
 
                        echo "<h2>Last 10 tracks received</h2>";
+               }
 }
 
 ?>
@@ -92,10 +94,11 @@
                        
<tr><th>User</th><th>Artist</th><th>Track</th><th>Time</th></tr>
 
 <?php
+                       catch (exception $e)
+                       {
+                               die($e->getMessage());
+                       }
 
-                       if(PEAR::isError($res)) {
-                               die($res->getMessage());
-                       }
                        $i = 0;
                        foreach($res as &$row){
                        $i++;





reply via email to

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