summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/class/playlist.class.php12
-rw-r--r--playlist.php2
2 files changed, 6 insertions, 8 deletions
diff --git a/lib/class/playlist.class.php b/lib/class/playlist.class.php
index 62628bb7..f46bc66f 100644
--- a/lib/class/playlist.class.php
+++ b/lib/class/playlist.class.php
@@ -418,13 +418,13 @@ class Playlist {
function normalize_tracks() {
/* First get all of the songs in order of their tracks */
- $sql = "SELECT id FROM playlist_data WHERE playlist='" . sql_escape($this->id) . "' ORDER BY track ASC";
- $db_results = mysql_query($sql, dbh());
+ $sql = "SELECT `id` FROM `playlist_data` WHERE `playlist`='" . Dba::escape($this->id) . "' ORDER BY `track` ASC";
+ $db_results = Dba::query($sql);
$i = 1;
$results = array();
- while ($r = mysql_fetch_assoc($db_results)) {
+ while ($r = Dba::fetch_assoc($db_results)) {
$new_data = array();
$new_data['id'] = $r['id'];
$new_data['track'] = $i;
@@ -433,9 +433,9 @@ class Playlist {
} // end while results
foreach($results as $data) {
- $sql = "UPDATE playlist_data SET track='" . $data['track'] . "' WHERE" .
- " id='" . $data['id'] . "'";
- $db_results = mysql_query($sql, dbh());
+ $sql = "UPDATE `playlist_data` SET `track`='" . $data['track'] . "' WHERE" .
+ " `id`='" . $data['id'] . "'";
+ $db_results = Dba::query($sql);
} // foreach re-ordered results
return true;
diff --git a/playlist.php b/playlist.php
index baff2e21..0add3ada 100644
--- a/playlist.php
+++ b/playlist.php
@@ -142,8 +142,6 @@ switch ($_REQUEST['action']) {
/* Normalize the tracks */
$playlist->normalize_tracks();
-
- break;
default:
require_once Config::get('prefix') . '/templates/show_playlist.inc.php';
break;