diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-07-31 03:12:12 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-07-31 03:12:12 +0000 |
commit | d48a431606385a618a31eb007b1527c8d8dd075d (patch) | |
tree | 3f551897a57aa939a7ea20796bcf645477d7b2d2 /lib | |
parent | 1fc55df5bd2cf33c9a68789f9c2b26e50139eb85 (diff) | |
download | ampache-d48a431606385a618a31eb007b1527c8d8dd075d.tar.gz ampache-d48a431606385a618a31eb007b1527c8d8dd075d.tar.bz2 ampache-d48a431606385a618a31eb007b1527c8d8dd075d.zip |
fixed searching via quicksearch bar
Diffstat (limited to 'lib')
-rw-r--r-- | lib/playlist.lib.php | 6 | ||||
-rw-r--r-- | lib/search.php | 9 |
2 files changed, 7 insertions, 8 deletions
diff --git a/lib/playlist.lib.php b/lib/playlist.lib.php index 5889a4b6..c695579b 100644 --- a/lib/playlist.lib.php +++ b/lib/playlist.lib.php @@ -145,12 +145,12 @@ function show_playlist_select($playlist_id=0,$type='') { $where_sql = '1=1'; } else { - $where_sql = " `user` = '" . sql_escape($GLOBALS['user']->id) . "'"; + $where_sql = " `user` = '" . Dba::escape($GLOBALS['user']->id) . "'"; } $sql = "SELECT id,name FROM playlist " . - "WHERE " . $where_sql . " ORDER BY name"; - $db_results = mysql_query($sql,dbh()); + "WHERE " . $where_sql . " ORDER BY `name`"; + $db_results = Dba::query($sql); echo "<select name=\"playlist_id\">\n"; diff --git a/lib/search.php b/lib/search.php index 061f8572..e9f76461 100644 --- a/lib/search.php +++ b/lib/search.php @@ -42,7 +42,7 @@ function run_search($data) { if ($prefix == 's_' AND strlen($value)) { $true_name = substr($key,2,strlen($key)); - $search[$true_name] = sql_escape($value); + $search[$true_name] = Dba::escape($value); } } // end foreach @@ -219,11 +219,10 @@ function search_song($data,$operator,$method,$limit) { */ $_SESSION['userdata']['stored_search'] = $sql; - //echo "DEBUG: $sql<br />"; flush(); - $db_results = mysql_query($sql, dbh()); + $db_results = Dba::query($sql); - while ($r = mysql_fetch_assoc($db_results)) { - $results[] = new Song($r['id']); + while ($row = Dba::fetch_assoc($db_results)) { + $results[] = $row['id']; } return $results; |