projects
/
fa-stable.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5001c19
)
0001767: Company Creation assigning externally created database + Fix
author
Joe Hunt
<joe.hunt.consulting@gmail.com>
Sat, 8 Sep 2012 06:20:20 +0000
(08:20 +0200)
committer
Joe Hunt
<joe.hunt.consulting@gmail.com>
Sat, 8 Sep 2012 06:20:20 +0000
(08:20 +0200)
includes/db/connect_db.inc
patch
|
blob
|
history
diff --git
a/includes/db/connect_db.inc
b/includes/db/connect_db.inc
index c181b98952e434744cc1018d3868a2aeefef5439..b0c33f6489c30f2fbf18368a822cfc0bd0027d41 100644
(file)
--- 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))
{
$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;
}
if (!mysql_query($sql) || !mysql_select_db($connection["dbname"], $db))
return 0;
}
@@
-186,7
+186,7
@@
function db_drop_db($connection)
if ($connection["tbpref"] == "")
{
if ($connection["tbpref"] == "")
{
- $sql = "DROP DATABASE " . $connection["dbname"] . "";
+ $sql = "DROP DATABASE
IF EXISTS
" . $connection["dbname"] . "";
return mysql_query($sql);
}
else
return mysql_query($sql);
}
else