I have the following query:
$ad="INSERT INTO comanda_aberta set numero='$a', data_abertura=NOW(), data_fechamento=NULL";
mysqli_query($con,$ad);
$idcomandalast = mysqli_insert_id($con);
When I give a print in the variable $idcomandalast
it always returns empty. and in the database insert information is being recorded normally. Can anyone help me with this problem?