diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-03-19 05:34:59 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-03-19 05:34:59 +0000 |
commit | 17244cee94c89c4dcdc7fc58001790165ca2d7f1 (patch) | |
tree | 80b0e1d3980eb941c7195a90ea35f6f23ff6d5ee /lib/class/dba.class.php | |
parent | af2ca647bdd38611982354e16aa56bda4a87d8ef (diff) | |
download | ampache-17244cee94c89c4dcdc7fc58001790165ca2d7f1.tar.gz ampache-17244cee94c89c4dcdc7fc58001790165ca2d7f1.tar.bz2 ampache-17244cee94c89c4dcdc7fc58001790165ca2d7f1.zip |
add the title back in to the links and be a little more violent with the charset setting...
Diffstat (limited to 'lib/class/dba.class.php')
-rw-r--r-- | lib/class/dba.class.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/class/dba.class.php b/lib/class/dba.class.php index 3a348a46..71e6b6c8 100644 --- a/lib/class/dba.class.php +++ b/lib/class/dba.class.php @@ -1,7 +1,7 @@ <?php /* - Copyright (c) 2001 - 2007 Ampache.org + Copyright (c) 2001 - 2008 Ampache.org All rights reserved. This program is free software; you can redistribute it and/or @@ -164,6 +164,16 @@ class Dba { $dbh = mysql_connect($hostname,$username,$password); if (!$dbh) { debug_event('Database','Error unable to connect to database' . mysql_error(),'1'); } + if (function_exists('mysql_set_charset')) { + $sql_charset = str_replace("-","",Config::get('site_charset')); + $charset = mysql_set_charset($sql_charset,$dbh); + } + else { + $sql = "SET NAMES " . mysql_real_escape_string(str_replace("-","",Config::get('site_charset'))); + $charset = mysql_query($sql,$dbh); + } + if (!$charset) { debug_event('Database','Error unable to set connection charset, function missing or set failed','1'); } + $select_db = mysql_select_db($database,$dbh); if (!$select_db) { debug_event('Database','Error unable to select ' . $database . ' error ' . mysql_error(),'1'); } |