From c81e480daaa233c35fec262e9907d35179db5e86 Mon Sep 17 00:00:00 2001 From: "mckenzierobotics.org" Date: Mon, 5 Sep 2011 14:46:23 -0700 Subject: (mostly) Fix the installer. We still need to set baseurl in the 'conf' table manually. --- installer/include.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'installer/include.php') 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; +} -- cgit v1.2.3-54-g00ecf