close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Submit records in multiple rows not working

Thread began 5/24/2021 5:21 pm by Michael | Last modified 5/27/2021 7:45 pm by Michael | 609 views | 9 replies

Michael

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

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...