Hand coding additional fields in an INSERT or UPDATE behaviour - why might this not be working?
I have the following hand coded INSERT behaviour on a page:
<?php
if(!isset($_SESSION["SMCinUSERID"])) {
if (isset($_POST["btnADDSTEP1"]) || isset($_POST["btnADDSTEP1_x"])) {
$InsertQuery = new WA_MySQLi_Query($csdbmysqli);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "SMCuser";
$InsertQuery->bindColumn("SMCuserUSER", "s", "".((isset($_POST["EmailConfirm"]))?$_POST["EmailConfirm"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCuserFIRST", "s", "".((isset($_POST["FirstName"]))?$_POST["FirstName"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCuserSUR", "s", "".((isset($_POST["Surname"]))?$_POST["Surname"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCuserPASS", "s", "$hashed", "WA_DEFAULT");
if (isset($_POST["savedetailsCHECK"] ) && $_POST["savedetailsCHECK"] == 1) {
$InsertQuery->bindColumn("SMCuserADD", "s", "".((isset($_POST["Address"]))?$_POST["Address"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCuserADD1", "s", "".((isset($_POST["Address2"]))?$_POST["Address2"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCuserCITY", "s", "".((isset($_POST["City"]))?$_POST["City"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCuserREGION", "s", "".((isset($_POST["Region"]))?$_POST["Region"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCuserCOUNTRY", "i", "".((isset($_POST["Country"]))?$_POST["Country"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCuserZIP", "s", "".((isset($_POST["Postcode"]))?$_POST["Postcode"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCuserPHONE", "s", "".((isset($_POST["Telephone"]))?$_POST["Telephone"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCuserMOBILE", "s", "".((isset($_POST["Mobile"]))?$_POST["Mobile"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCuserDOB", "t", "".((isset($_POST["DOB"]))?$_POST["DOB"]:"") ."", "WA_DEFAULT");
}
$InsertQuery->saveInSession("NEWuserID");
$InsertQuery->execute();
$InsertGoTo = "";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";
$InsertQuery->redirect($InsertGoTo);
}
}
?>
This all works fine. I needed to add two new fields to this INSERT:
<?php
if(!isset($_SESSION["SMCinUSERID"])) {
if (isset($_POST["btnADDSTEP1"]) || isset($_POST["btnADDSTEP1_x"])) {
$InsertQuery = new WA_MySQLi_Query($csdbmysqli);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "SMCuser";
$InsertQuery->bindColumn("SMCuserUSER", "s", "".((isset($_POST["EmailConfirm"]))?$_POST["EmailConfirm"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCuserFIRST", "s", "".((isset($_POST["FirstName"]))?$_POST["FirstName"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCuserSUR", "s", "".((isset($_POST["Surname"]))?$_POST["Surname"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCuserPASS", "s", "$hashed", "WA_DEFAULT");
if (isset($_POST["savedetailsCHECK"] ) && $_POST["savedetailsCHECK"] == 1) {
$InsertQuery->bindColumn("SMCuserADD", "s", "".((isset($_POST["Address"]))?$_POST["Address"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCuserADD1", "s", "".((isset($_POST["Address2"]))?$_POST["Address2"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCuserCITY", "s", "".((isset($_POST["City"]))?$_POST["City"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCuserREGION", "s", "".((isset($_POST["Region"]))?$_POST["Region"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCuserCOUNTRY", "i", "".((isset($_POST["Country"]))?$_POST["Country"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCuserZIP", "s", "".((isset($_POST["Postcode"]))?$_POST["Postcode"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCuserPHONE", "s", "".((isset($_POST["Telephone"]))?$_POST["Telephone"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCuserMOBILE", "s", "".((isset($_POST["Mobile"]))?$_POST["Mobile"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCuserDOB", "t", "".((isset($_POST["DOB"]))?$_POST["DOB"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCuserBIRTHCITY", "s", "".((isset($_POST["BirthCity"]))?$_POST["BirthCity"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCuserBIRTHCOUNTRY", "i", "".((isset($_POST["BirthCountry"]))?$_POST["BirthCountry"]:"") ."", "WA_DEFAULT");
}
$InsertQuery->saveInSession("NEWuserID");
$InsertQuery->execute();
$InsertGoTo = "";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";
$InsertQuery->redirect($InsertGoTo);
}
}
?>
...but it just won't save those two new fields to DB. Everything else still works (inserts) though?
Is it not possible to hand code it like this?
I've not used DW for a while and am getting all kinds of warning messages when I open up pages. Something about various elements - Recordsets, Server Behaviours, eCart, DynTextField and more - not defining the "findServerBehaviours function".
Could this be related?
Would appreciate your advice.
Thank you.
NJ