I want to insert data into my database I'm using mysqli, I need to know how I would indicate an array inside a variable, here and my code I want to know if this is the correct way to do it
require 'config.php'
require 'connection.php'
$nomearquivo ="teste.html";
$nome =$_POST["nome"];
$sexo =$_POST["sexo"];
$dia =$_POST["dia"];
$mes =$_POST["mes"];
$ano =$_POST["ano"];
$abre =@fopen("dadosss.html","a+");
$ess ="nome: " .$nome. " sexo: " .$sexo." ".$dia."/".$mes."/".$ano;
$escreve =fwrite($abre, $ess );
$inserir = array(
'nome' => $nome,
'sexo' => $sexo,
'dia' => $dia,
'mes' => $mes,
'ano' => $ano,
);
$grava = DBCreate('cadastro', $inserir);
if($grava)
echo 'OK';