Issue #30: Fixes database_prefix option during install
This commit is contained in:
@@ -31,7 +31,7 @@ class Database {
|
||||
}
|
||||
|
||||
// Function to create the tables and fill them with the default data
|
||||
function create_tables($db_host, $db_user, $db_password, $db_name, $db_port)
|
||||
function create_tables($db_host, $db_user, $db_password, $db_name, $db_port, $db_prefix)
|
||||
{
|
||||
// Connect to the database
|
||||
$mysqli = new mysqli($db_host,$db_user,$db_password,$db_name, $db_port);
|
||||
@@ -43,6 +43,9 @@ class Database {
|
||||
// Open the default SQL file
|
||||
$query = file_get_contents('sql/sample_data.sql');
|
||||
|
||||
// Run prefix regex; if none is set, then it will replace #prefix# with an empty string.
|
||||
$query = preg_replace('/#prefix#/', $db_prefix, $query);
|
||||
|
||||
// Execute a multi query
|
||||
$mysqli->multi_query($query);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user