new installation process via script, elimination of data entry form for installation

Signed-off-by: giandonato.inverso@edempg.it <Zannabianca20>
This commit is contained in:
Giandonato Inverso
2022-08-28 11:57:31 +02:00
committed by giandonato.inverso@edempg.it
parent fef45c401a
commit 00d7dfdb0b
8 changed files with 89 additions and 537 deletions
+14 -14
View File
@@ -1,28 +1,28 @@
/**
* PHP Dynamic Qr code
*
* @author Giandonato Inverso <info@giandonatoinverso.it>
* @copyright Copyright (c) 2020-2021
* @license https://opensource.org/licenses/MIT MIT License
* @link https://github.com/giandonatoinverso/PHP-Dynamic-Qr-code
* @version 1.0
*/
<?php
/**
* PHP Dynamic Qr code
*
* @author Giandonato Inverso <info@giandonatoinverso.it>
* @copyright Copyright (c) 2020-2021
* @license https://opensource.org/licenses/MIT MIT License
* @link https://github.com/giandonatoinverso/PHP-Dynamic-Qr-code
* @version 1.0
*/
class Database {
// Function to the database and tables and fill them with the default data
function create_database($data)
function create_database($db_host, $db_user, $db_password, $db_name, $db_port)
{
// Connect to the database
$mysqli = new mysqli($data['db_host'],$data['db_user'],$data['db_password'],'');
$mysqli = new mysqli($db_host,$db_user,$db_password,'', $db_port);
// Check for errors
if(mysqli_connect_errno())
return false;
// Create the prepared statement
$mysqli->query("CREATE DATABASE IF NOT EXISTS ".$data['db_name']);
$mysqli->query("CREATE DATABASE IF NOT EXISTS ".$db_name);
// Close the connection
$mysqli->close();
@@ -31,10 +31,10 @@ class Database {
}
// Function to create the tables and fill them with the default data
function create_tables($data)
function create_tables($db_host, $db_user, $db_password, $db_name, $db_port)
{
// Connect to the database
$mysqli = new mysqli($data['db_host'],$data['db_user'],$data['db_password'],$data['db_name']);
$mysqli = new mysqli($db_host,$db_user,$db_password,$db_name, $db_port);
// Check for errors
if(mysqli_connect_errno())