|
Please, post the query. Sorry for this late answer, you was very promptly, thanks. I supposed an e-mail notification for new replies come in by default, but I learned that I have to ask for it in the first post. Here is the code for "before record added" for the table "Add Page":
global $conn; // next VERSAMENTI ID
$strSQL = "SELECT seq FROM sqlite_sequence WHERE name=\"VERSAMENTI\"";
$rs = db_query($strSQL, $conn);
while ($row = db_fetch_array($rs)) {
$versNextId = $row["seq"]+1;
$versNextId = "$versNextId";
//print("VERS NEXT ID: $versNextId");
}
$note = $values["NOTE"];
if ($note=="")
$strSQLInsert = "INSERT INTO VERSAMENTI (ID, DATA_V, VERSAMENTO, MESE) values ($versNextId , \"".$values["DATA_V"]."\", ".$values["VERSAMENTO"].", ".$values["MESE"].")";
else
$strSQLInsert = "INSERT INTO VERSAMENTI (ID, DATA_V, VERSAMENTO, MESE, NOTE) values ($versNextId , \"".$values["DATA_V"]."\", ".$values["VERSAMENTO"].", ".$values["MESE"].", \"$note\")"; //print " strSQLInsert = $strSQLInsert <BR>"; db_exec($strSQLInsert,$conn); $newValues = array("CORSO_ID"=>$values["CORSO_ID"], "SOCIO_ID"=>$values["SOCIO_ID"], "VERS_ID"=>$versNextId); /*print "<BR>";
var_dump($newValues);
print "<BR>;";
var_dump($values);
print "<BR>;";*/ $values = $newValues; return true;
|