summaryrefslogtreecommitdiff
path: root/installer/include.php
diff options
context:
space:
mode:
Diffstat (limited to 'installer/include.php')
-rw-r--r--installer/include.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/installer/include.php b/installer/include.php
index 7300e90..b7f7b19 100644
--- a/installer/include.php
+++ b/installer/include.php
@@ -79,3 +79,18 @@ function mm_mysql_table_exists($mysql, $table_name) {
$total = $total[0];
return $total>0;
}
+
+function mm_mysql_create_table($mysql, $table_name, $columns) {
+ $table_exists = mm_mysql_table_exists($mysql, $table_name);
+ if ($table_exists) {
+ return 0;
+ }
+ $query ="CREATE TABLE $table_name (\n";
+ $query.=implode(",\n ", $columns);
+ $query.="\n);";
+ $success = mysql_query($query);
+ if (!$success) {
+ return mysql_error($mysql);
+ }
+ return 1;
+}