Submit records in multiple rows not working
Hello Ray,
Please I kindly need your help on this. I have a form with 3 different array fields prt_id, mds_id and ptid but when I submit the form, only one record in prt_id is submitted and one row only instead of 9 six rows as I selected 3 different options in the 3 dropdown select fields
What am I not doing well looking at my code below:
<?php
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$InsertQuery = new WA_MySQLi_Query($FRCDB);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "verification";
$InsertQuery->bindColumn("prt_id", "i", "".($_POST["prt_id"][$x]) ."", "WA_DEFAULT");
$InsertQuery->bindColumn("mds_id", "i", "".($_POST["mds_id"][$x]) ."", "WA_DEFAULT");
$InsertQuery->bindColumn("aimsobj", "s", "".((isset($_POST["aimsobj"]))?$_POST["aimsobj"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("ptid", "i", "".($_POST["ptid"][$x]) ."", "WA_DEFAULT");
$InsertQuery->bindColumn("phyinspctn", "s", "".((isset($_POST["phyinspctn"]))?$_POST["phyinspctn"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("mdamtng", "s", "".((isset($_POST["mdamtng"]))?$_POST["mdamtng"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("contctmtng", "s", "".((isset($_POST["contctmtng"]))?$_POST["contctmtng"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("consntmtng", "s", "".((isset($_POST["consntmtng"]))?$_POST["consntmtng"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("others", "s", "".((isset($_POST["others"]))?$_POST["others"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("recomnds", "s", "".((isset($_POST["recomnds"]))?$_POST["recomnds"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("addedby", "s", "".((isset($_POST["addedby"]))?$_POST["addedby"]:"") ."", "WA_DEFAULT");
$InsertQuery->saveInSession("pjv_id");
$InsertQuery->execute();
$InsertGoTo = "verification";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";
$InsertQuery->redirect($InsertGoTo);
}
?>
Thank you