Unable to insert a record in a table in php mysql

I am unable to insert the record in a table and even not getting any error but when I am trying to create a table with the same method the query is executing correctly. I stuck with this problem from last 2 days. can anyone please help me out. $database->create_database() function is used to create the dynamic database. $database->create_tables() function is used to create the tables with MySQL multi-query method.

index.php

<?php

ini_set('display_errors', '1');
error_reporting(E_ALL);

session_start();

$dbusername = $_SESSION['dbusername'];
$dbpassword=$_SESSION['dbpassword'];
$dbname=$_SESSION['dbname'];
$clienturl=$_SESSION['clienturl'];
$email=$_SESSION['email'];


error_reporting(0); 

$db_config_path = '../application/config/database.php';


$_POST = array('hostname' => 'localhost' ,
           'username' =>  $dbusername,
           'password' =>  $dbpassword,
           'database' =>  $dbname ,
           'clienturl' =>  $clienturl ,

          );

require_once 'includes/core_class.php';
require_once 'includes/database_class.php';

$core = new Core();
$database = new Database();

// Validate the post data
if ($core->validate_post($_POST) == true) {

    // First create the database, then create tables, then write a config file

    if ($database->create_database($_POST) == false) {
        $message = $core->show_message('error', 'The database could not be created, please verify your settings.');
    }
     elseif($database->create_tables($_POST) == false) {
        $message = $core->show_message('error', 'The database tables could not be created, please verify your settings.');
    } 

    elseif ($core->write_config_url($_POST) == false) {
        $message = $core->show_message('error', 'The database configuration url file could not be written, please chmod application/config/database.php file to 777');
    }

     elseif ($core->write_config($_POST) == false) {
        $message = $core->show_message('error', 'The database configuration file could not be written, please chmod application/config/database.php file to 777');

    } 
    elseif ($database->update_tables($_POST) == false) {
        $message = $core->show_message('error', 'There is a problem while updating email id and password');
    } 

    // If no errors, redirect to registration page
    if (!isset($message)) {


        $redir = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http');
        $redir .= '://'.$_SERVER['HTTP_HOST'];
        $redir .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
        $redir = str_replace('install/', '', $redir);
        header('Location: '.$redir);
    }

} else {
    $message = $core->show_message('error', 'Not all fields have been filled in correctly. The host, username, password, and database name are required.');
}
//}

?>

database_class.php file

<?php

class Database
{
// Function to the database and tables and fill them with the default data
public function create_database($data)
{
    // Connect to the database
    $mysqli = new mysqli($data['hostname'], $data['username'], $data['password'], '');

    // Check for errors
    if (mysqli_connect_errno()) {
        return false;
    }

    // Create the prepared statement
    $mysqli->query('CREATE DATABASE IF NOT EXISTS '.$data['database']);

    // Close the connection
    $mysqli->close();

    return true;
}

// Function to create the tables and fill them with the default data
public function create_tables($data)
{
    // Connect to the database
    $mysqli = new mysqli($data['hostname'], $data['username'], $data['password'], $data['database']);

    // Check for errors
    if (mysqli_connect_errno()) {
        return false;
    }

    // Open the default SQL file
    $query = file_get_contents('assets/install.sql');

    // Execute a multi query
    $mysqli->multi_query($query);



    // Close the connection
    $mysqli->close();

    return true;
}


public function update_tables($data)
{

    // Connect to the database
    $mysqli = new mysqli($data['hostname'], $data['username'], $data['password'], $data['database']);

    // Check for errors
    if (mysqli_connect_errno()) {
        return false;
    }


   $insert =  "INSERT INTO xyz (firstname) VALUES ('Tacos')";

   $mysqli->query($insert);

    $mysqli->close();

    return true;
}

}

and core_class.php class is used to validate the form data and write some config files.