i find that there is no error,the update statement works.but not the insert statement😐 can anyone check whats wrong with the code? p/s ignore the code in the earlier post
//form action
// build the form action
$editFormAction = $HTTP_SERVER_VARS['PHP_SELF'] . (isset($HTTP_SERVER_VARS['QUERY_STRING']) ? "?" . $HTTP_SERVER_VARS['QUERY_STRING'] : "");
if ((isset($HTTP_POST_VARS["MM_update"])) && ($HTTP_POST_VARS["MM_update"] == "form1")) {
$updateSQL = sprintf("UPDATE pinjaman SET status=%s, hariAmbil=%s, bulanAmbil=%s, tahunAmbil=%s, jamAmbil=%s, AMAmbil=%s, namaPegawai=%s, catatan=%s, dikembalikan=%s, hariLulus=%s, bulanLulus=%s, tahunLulus=%s WHERE idPinjam=%s;",
GetSQLValueString($HTTP_POST_VARS['status'], "text"),
GetSQLValueString($HTTP_POST_VARS['hariAmbil'], "text"),
GetSQLValueString($HTTP_POST_VARS['bulanAmbil'], "text"),
GetSQLValueString($HTTP_POST_VARS['tahunAmbil'], "text"),
GetSQLValueString($HTTP_POST_VARS['jamAmbil'], "text"),
GetSQLValueString($HTTP_POST_VARS['AMAmbil'], "text"),
GetSQLValueString($HTTP_POST_VARS['namaPegawai'], "text"),
GetSQLValueString($HTTP_POST_VARS['catatan'], "text"),
GetSQLValueString($HTTP_POST_VARS['dikembalikan'], "text"),
GetSQLValueString($HTTP_POST_VARS['hariLulus'], "text"),
GetSQLValueString($HTTP_POST_VARS['bulanLulus'], "text"),
GetSQLValueString($HTTP_POST_VARS['tahunLulus'], "text"),
GetSQLValueString($HTTP_POST_VARS['idPinjam'], "int"));
$insertSQL = sprintf("INSERT INTO log (tarikhAkses, masaAkses,pengguna) VALUES (%s,%s,%s)",
GetSQLValueString($HTTP_POST_VARS['tarikhAkses'],"text"),
GetSQLValueString($HTTP_POST_VARS['masaAkses'],"text"),
GetSQLValueString($HTTP_POST_VARS['pengguna'],"text"));
$Result1 = $connICT->Execute($updateSQL) or die($connICT->ErrorMsg());
$Result2 = $connICT->Execute($insertSQL) or die($connICT->ErrorMsg());
$updateGoTo = "sah2.php";
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
}
KT_redir($updateGoTo);
}