Problem with mysql function mysqli_insert_id ()

0

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?

    
asked by anonymous 22.09.2017 / 03:00

0 answers