I am not using HTML form to get values for this query. I am just inserting a second query once user creates a specific record. However, the second query is not inserting '0' unless I change it to VARCHAR. Others are working fine except for number.
$null = null;
$query2="insert into npi_program2 (prodID,prodName,TPM,scheme,phases,status,number,date,remarkProg)
values('$prodID','$prodName','$null','$null','$null', 0 ,DATE_FORMAT(NOW(),'%b-%d-%Y'),'$null')";
$res1=$db->query($query2);
DEFAULTvalue of the column toNULL$null = 'null';(the value must be string, not predefined PHP constant) and remove them in.. , $null, ..(the value must be inserted as predefined MySQL constant, not as string literal).mysqliorPDO?