summaryrefslogtreecommitdiffstats
path: root/lib/install.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-11-04 08:15:40 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-11-04 08:15:40 +0000
commitb315ff2d260209c2d99ee056ed974585caf9f6cf (patch)
tree4c3e13f84b5b6cce764fb587c7a245c02b50a3b3 /lib/install.php
parent2169a44d52a35ed05ca098235247dde078bd223d (diff)
downloadampache-b315ff2d260209c2d99ee056ed974585caf9f6cf.tar.gz
ampache-b315ff2d260209c2d99ee056ed974585caf9f6cf.tar.bz2
ampache-b315ff2d260209c2d99ee056ed974585caf9f6cf.zip
some minror tweaks
Diffstat (limited to 'lib/install.php')
-rw-r--r--lib/install.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/install.php b/lib/install.php
index a45d1c98..70b38780 100644
--- a/lib/install.php
+++ b/lib/install.php
@@ -83,9 +83,10 @@ function install_check_status($configfile) {
*/
$results = read_config($GLOBALS['configfile'], 0, 0);
$dbh = check_database($results['local_host'],$results['local_username'],$results['local_pass']);
-
+
if (is_resource($dbh)) {
- mysql_select_db($results['local_db'],$dbh);
+ $db_select = mysql_select_db($results['local_db'],$dbh);
+
$sql = "SELECT * FROM user";
$db_results = @mysql_query($sql, $dbh);
if (!@mysql_num_rows($db_results)) {
@@ -93,6 +94,7 @@ function install_check_status($configfile) {
}
}
+
/* Defaut to no */
return false;
@@ -110,6 +112,11 @@ function install_insert_db($username,$password,$hostname,$database) {
/* Attempt to make DB connection */
$dbh = @mysql_pconnect($hostname,$username,$password);
+ if (!is_resource($dbh)) {
+ $GLOBALS['error']->add_error('general',"Error: Unable to make Database Connection " . mysql_error());
+ return false;
+ }
+
/* Check/Create Database as needed */
$db_selected = @mysql_select_db($database, $dbh);
if (!$db_selected) {