Deal gracefully with bad mysql connection and database information.

This commit is contained in:
Bharat Mediratta 2009-01-20 04:56:10 +00:00
parent 0c6b36b086
commit 8384cac5e3
3 changed files with 19 additions and 2 deletions

View File

@ -78,7 +78,7 @@ class installer {
} }
static function connect($config) { static function connect($config) {
return mysql_connect($config["host"], $config["user"], $config["password"]); return @mysql_connect($config["host"], $config["user"], $config["password"]);
} }
static function select_db($config) { static function select_db($config) {

View File

@ -0,0 +1,6 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<h1> Uh oh! </h1>
<p class="error">
We were unable to connect to your MySQL server with the username and
password that you provided. Please go back and try again!
</p>

View File

@ -1,2 +1,13 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<h1> Can't find that database! </h1>
<p class="error">
We were able to connect to your MySQL server, yay! But the database
name you gave us doesn't exist and we don't have permissions to
create it for you. Please create the database manually, then go
back and try again.
</p>
<p> <p>
< If you're having trouble creating the database, please contact your
web host or system administrator for assistance.
</p>