Fail insert data into table

I’m using PHP to connect to the database, and using a simple Insert and always failed . but On local host was successfully.

koneksi.php :

<?php

        $server="localhost";
        $user="myUsername";
        $password="myPassword";
        $database="myDBName";
        $mysqli =mysqli_connect($server,$user,$password,$database);

        $connect = new mysqli($server,$user,$password,$database);
        if ($connect->connect_error) {
           die('Error: '. $connect->connect_error);
        }
    ?>

add_admin.php :

<?php
    require_once("config/koneksi.php");

    $nama=$_POST['nama'];
    $username=$_POST['username'];
    $password=md5($_POST['password']);
   
    
    $query= "insert into admin(id_admin, nama_admin, username, password, hak_akses) 
            values('','$nama','$username','$password','Admin')";
    

    if(mysqli_query($connect,$query)){
    	echo"<script>alert('added successfully')
    		window.location='index.php?page=data-admin'</script>";
    }else{
    	echo"<script>alert('failed to add')
    		history.back();</script>";
    }
?>

Hi!

We’re using MariaDB as SQL Server System. The syntax may be a bit different than the one of the traditional SQL. You should use this query instead:

insert into admin(col, names, here, separated, by, commas)
 values('','$nama','$username','$password','Admin')

i already changed my code, but still failed…

<?php
            require_once("config/koneksi.php");

            $nama=$_POST['nama'];
            $username=$_POST['username'];
            $password=md5($_POST['password']);
           
            
            $query= "insert into admin(id_admin, nama_admin, username, password, hak_akses) 
                    values('','$nama','$username','$password','Admin')";
            

            if(mysqli_query($connect,$query)){
            	echo"<script>alert('added successfully')
            		window.location='index.php?page=data-admin'</script>";
            }else{
            	echo"<script>alert('failed to add')
            		history.back();</script>";
            }
        ?>