Bryan Wong Bryan Wong - 1 year ago 45
PHP Question

undefined index

Is there any wrong with this statement?

Error return:


Notice: Undefined index: inputBlock

Notice: Undefined index: inputHouseUnit


code:

if($conn){
$insertData = "INSERT INTO ESTATEUNIT (BLOCK, UNIT) VALUES ('$_POST[inputBlock]', '$_POST[inputHouseUnit]')";
}

Answer Source
$insertData = "INSERT INTO ESTATEUNIT (BLOCK, UNIT) VALUES ('".$_POST['inputBlock']."', '".$_POST['inputHouseUnit']."')";
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download