How to get the last ID when inserting in MySQL BD using PHP and MYSQLi.
$inserir = $conexao->query("INSERT INTO cadastro (nome, sobrenome) VALUE (
'Fulano',
'De tall'
");
echo $id = mysqli_insert_id($conexao);
You are returning 0.