Portions created by the Initial Developer are Copyright (C) 2008-2012 the Initial Developer. All Rights Reserved. Contributor(s): Ken Rice Mark J Crane */ function sql_tables($db_type) { $x = 0; include "app_config.php"; $sql = ""; foreach ($apps[$x]['db'] as $new_db) { $sql .= "CREATE TABLE " . $new_db['table'] . " (\n"; $fcount = 0; foreach ($new_db['fields'] as $field) { if ($fcount > 0 ) { $sql .= ",\n"; } $sql .= $field['name'] . " "; if (is_array($field['type'])) { $sql .= $field['type'][$db_type]; } else { $sql .= $field['type']; } $fcount++; } $sql .= ");\n\n"; } return $sql; } ?>