- $filename = $_FILES['uploadfile']['tmp_name'];
- if (is_uploaded_file ($filename))
- {
- if (!db_import($filename, $conn, $id)) {
- display_error(_('Cannot create new company due to bugs in sql file.'));
- $error = true;
- } else
- if (isset($_POST['admpassword']) && $_POST['admpassword'] != "")
- update_admin_password($conn, md5($_POST['admpassword']));
- }
- else
- {
- display_error(_("Error uploading Database Script, please upload it manually"));
- $error = true;
- }
- }
- set_global_connection();
- if ($error) {
- remove_connection($id);
- return false;
- }
+ $conn = $db_connections[$selected_id];
+ if (($db = db_create_db($conn)) == 0)
+ {
+ display_error(_("Error creating Database: ") . $conn['dbname'] . _(", Please create it manually"));
+ $error = true;