From: Joe Hunt Date: Sat, 8 Sep 2012 06:20:20 +0000 (+0200) Subject: 0001767: Company Creation assigning externally created database + Fix X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=1bda10fd4dc8bee8869bd9e49f80c06ee057ea2b;p=textcart.git 0001767: Company Creation assigning externally created database + Fix --- diff --git a/includes/db/connect_db.inc b/includes/db/connect_db.inc index c181b98..b0c33f6 100644 --- a/includes/db/connect_db.inc +++ b/includes/db/connect_db.inc @@ -174,7 +174,7 @@ function db_create_db($connection) $connection["dbuser"], $connection["dbpassword"]); if (!mysql_select_db($connection["dbname"], $db)) { - $sql = "CREATE DATABASE " . $connection["dbname"] . ""; + $sql = "CREATE DATABASE IF NOT EXISTS " . $connection["dbname"] . ""; if (!mysql_query($sql) || !mysql_select_db($connection["dbname"], $db)) return 0; } @@ -186,7 +186,7 @@ function db_drop_db($connection) if ($connection["tbpref"] == "") { - $sql = "DROP DATABASE " . $connection["dbname"] . ""; + $sql = "DROP DATABASE IF EXISTS " . $connection["dbname"] . ""; return mysql_query($sql); } else