diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-03-17 05:47:07 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-03-17 05:47:07 +0000 |
commit | 0a401c7ca475c0e65bbdd9212f1b6a439239c94e (patch) | |
tree | 4b10e4a0e212d82fd0d4e01af4a0bb438ca9794e /lib/install.php | |
parent | 629efec5fa1a55f9284fa8acdc3333b442e9635e (diff) | |
download | ampache-0a401c7ca475c0e65bbdd9212f1b6a439239c94e.tar.gz ampache-0a401c7ca475c0e65bbdd9212f1b6a439239c94e.tar.bz2 ampache-0a401c7ca475c0e65bbdd9212f1b6a439239c94e.zip |
updated sql files, tweak to the update and installers to make it more utf-8ish hopefully final commit before release
Diffstat (limited to 'lib/install.php')
-rw-r--r-- | lib/install.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/install.php b/lib/install.php index d901e508..838da84f 100644 --- a/lib/install.php +++ b/lib/install.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 @@ -153,12 +153,11 @@ function install_insert_db($username,$password,$hostname,$database) { } // end if we are creating a user // Figure out which version of MySQL we're running, if possible we want to use the UTF-8 dump - $sql = "SELECT version()"; - $db_results = @mysql_query($sql,$dbh); + $sql = "SELECT VERSION()"; + $db_results = mysql_query($sql,$dbh); - $data = mysql_fetch_assoc($db_results,$dbh); + $data = mysql_fetch_row($db_results); $mysql_version = substr(preg_replace("/(\d+)\.(\d+)\.(\d+).*/","$1$2$3",$data[0]),0,3); - $sql_file = ($mysql_version < '500') ? 'sql/ampache40.sql' : 'sql/ampache.sql'; /* Attempt to insert database */ @@ -175,6 +174,11 @@ function install_insert_db($username,$password,$hostname,$database) { } // end if } // end for + if ($mysql_version >= '500') { + $sql = "ALTER DATABASE `" . Dba::escape($database) . "` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci"; + $db_results = mysql_query($sql); + } + return true; } // install_insert_db |