mysqli_insert_id() always returning null.I cannot understand the reason for this
$blocksql="insert into blockinfo values(NULL,'$user','$book','$blocktime','$quant1','$flag','$title')";
mysqli_query($con,$blocksql);
$id=mysqli_insert_id();