From 1a2953825a3cd294b5ea5decc618e94e58e7bdad Mon Sep 17 00:00:00 2001
From: jakani24
Date: Sat, 20 Jan 2024 10:59:36 +0100
Subject: [PATCH] Update create_db.php
---
.../cyberhex-code/install/create_db.php | 115 +++++++++++-------
1 file changed, 74 insertions(+), 41 deletions(-)
diff --git a/src/server/cyberhex-code/install/create_db.php b/src/server/cyberhex-code/install/create_db.php
index d19ecfd..7319bac 100644
--- a/src/server/cyberhex-code/install/create_db.php
+++ b/src/server/cyberhex-code/install/create_db.php
@@ -1,30 +1,34 @@
-
-
-
- Cyberhex Installation
-
+
+
+
+ Cyberhex login page
- We are creating the databases used in cyberhex, please stand by
-
If the creation fails, please wait a minute and try again. The database server might still be starting at the time.
+
+
+
+
+
+
+
+
If the creation fails, please wait a minute and try again. The database server might still be starting at the time.
+
+
+
+
+
+
+
+
+
+
+
+
connect_error) {
// Create database
$sql = "CREATE DATABASE IF NOT EXISTS $DB_DATABASE";
if ($conn->query($sql) === TRUE) {
- echo "Database created successfully
";
+ echo '
+ Database created successfully!
+
';
} else {
$success=0;
- echo "Error creating database: " . $conn->error ."
";
+ echo '
+ Error creating database: ' . $conn->error .'
+
';
}
$conn->close();
@@ -71,10 +79,14 @@ $sql = "CREATE TABLE IF NOT EXISTS users (
)";
if ($conn->query($sql) === TRUE) {
- echo "Table 'users' created successfully
";
+ echo '
+ Table users created successfully!
+
';
} else {
$success=0;
- echo "Error creating table: " . $conn->error ."
";
+ echo '
+ Error creating table users: ' . $conn->error .'
+
';
}
// Create log table
@@ -86,10 +98,14 @@ $sql = "CREATE TABLE IF NOT EXISTS log (
)";
if ($conn->query($sql) === TRUE) {
- echo "Table 'log' created successfully
";
+ echo '
+ Table log created successfully!
+
';
} else {
$success=0;
- echo "Error creating table: " . $conn->error ."
";
+ echo '
+ Error creating table log: ' . $conn->error .'
+
';
}
// Create settings table
@@ -100,10 +116,14 @@ $sql = "CREATE TABLE IF NOT EXISTS settings (
)";
if ($conn->query($sql) === TRUE) {
- echo "Table 'settings' created successfully
";
+ echo '
+ Table settings created successfully!
+
';
} else {
$success=0;
- echo "Error creating table: " . $conn->error ."
";
+ echo '
+ Error creating table settings: ' . $conn->error .'
+
';
}
// Create api table
@@ -114,10 +134,14 @@ $sql = "CREATE TABLE IF NOT EXISTS api (
)";
if ($conn->query($sql) === TRUE) {
- echo "Table 'api' created successfully
";
+ echo '
+ Table api created successfully!
+
';
} else {
$success=0;
- echo "Error creating table: " . $conn->error ."
";
+ echo '
+ Error creating table api: ' . $conn->error .'
+
';
}
// Create secrets table
@@ -128,10 +152,14 @@ $sql = "CREATE TABLE IF NOT EXISTS secrets (
)";
if ($conn->query($sql) === TRUE) {
- echo "Table 'secrets' created successfully
";
+ echo '
+ Table secrets created successfully!
+
';
} else {
$success=0;
- echo "Error creating table: " . $conn->error ."
";
+ echo '
+ Error creating table secrets: ' . $conn->error .'
+
';
}
// Create machine table
@@ -143,22 +171,27 @@ $sql = "CREATE TABLE IF NOT EXISTS machines (
)";
if ($conn->query($sql) === TRUE) {
- echo "Table 'machines' created successfully
";
+ echo '
+ Table machines created successfully!
+
';
} else {
$success=0;
- echo "Error creating table: " . $conn->error ."
";
+ echo '
+ Error creating table machines: ' . $conn->error .'
+
';
}
if($success!==1){
- echo('There was an error creating the databases. Please try again or contact support at: info.jakach@gmail.com
');
+ echo '
+ There was an error creating the databases. Please try again or contact support at:
info.jakach@gmail.com
+
';
}else{
- echo('Database created successfully! Continue installation
');
+ echo '
';
}
$conn->close();
?>
-