[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Librefm-commits] [1231] try out adodb for the mbid-mismatch report
From: |
Clint Adams |
Subject: |
[Librefm-commits] [1231] try out adodb for the mbid-mismatch report |
Date: |
Wed, 06 May 2009 19:08:21 +0000 |
Revision: 1231
http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1231
Author: clint
Date: 2009-05-06 19:08:21 +0000 (Wed, 06 May 2009)
Log Message:
-----------
try out adodb for the mbid-mismatch report
Modified Paths:
--------------
trunk/nixtape/admin/report/mbid-mismatch.php
Added Paths:
-----------
trunk/nixtape/database2.php
Modified: trunk/nixtape/admin/report/mbid-mismatch.php
===================================================================
--- trunk/nixtape/admin/report/mbid-mismatch.php 2009-05-06 18:13:16 UTC
(rev 1230)
+++ trunk/nixtape/admin/report/mbid-mismatch.php 2009-05-06 19:08:21 UTC
(rev 1231)
@@ -20,7 +20,7 @@
*/
require("../../config.php");
-require_once($install_path . '/database.php');
+require_once($install_path . '/database2.php');
require_once($install_path . '/templating.php');
require_once($install_path . '/data/sanitize.php');
@@ -28,15 +28,18 @@
$smarty->cache_lifetime = 43200;
if(!$smarty->is_cached('mbid-mismatch-report.tpl')) {
- $res = $mdb2->query("SELECT t.id, t.artist, t.album, t.name, t.mbid as
tmbid, st.mbid as stmbid FROM Scrobble_Track st JOIN Track t ON
lower(t.name)=st.name AND lower(t.album)=st.album AND lower(t.artist)=st.artist
AND t.mbid<>st.mbid");
+ $adodb->SetFetchMode(ADODB_FETCH_ASSOC);
+ $recordSet = &$adodb->Execute('SELECT t.id, t.artist, t.album, t.name,
t.mbid as tmbid, st.mbid as stmbid FROM Scrobble_Track st JOIN Track t ON
lower(t.name)=st.name AND lower(t.album)=st.album AND lower(t.artist)=st.artist
AND t.mbid<>st.mbid');
$aEntries = array();
$i = 0;
- while (($row = $res->fetchRow(MDB2_FETCHMODE_ASSOC))) {
- $trow = sanitize($row);
+ while (!$recordSet->EOF) {
+ $trow = sanitize($recordSet);
$aEntries[$i++] = $trow;
+ $recordSet->MoveNext();
}
+
$smarty->assign("entries", $aEntries);
}
Added: trunk/nixtape/database2.php
===================================================================
--- trunk/nixtape/database2.php (rev 0)
+++ trunk/nixtape/database2.php 2009-05-06 19:08:21 UTC (rev 1231)
@@ -0,0 +1,38 @@
+<?php
+
+/* Libre.fm -- a free network service for sharing your music listening habits
+
+ Copyright (C) 2009 Free Software Foundation, Inc
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+
+if(!file_exists(dirname(__FILE__) . "/config.php")) {
+ die("Please run the <a href='install.php'>Install</a> script to
configure your installation");
+}
+
+require_once('config.php');
+require_once('adodb-exceptions.inc.php');
+require_once('adodb.inc.php');
+
+try {
+ $adodb =& NewADOConnection($adodb_connect_string);
+} catch (exception $e) {
+ var_dump($e);
+ adodb_backtrace($e->gettrace());
+}
+
+?>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Librefm-commits] [1231] try out adodb for the mbid-mismatch report,
Clint Adams <=