close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

form multi select list insert records

Thread began 6/06/2016 3:34 pm by Christopher West | Last modified 2/20/2019 1:52 pm by Christopher West | 2815 views | 52 replies

LWat85283715

I am trying to do something similar but, for some reason, I am getting the correct number of rows inserted but, as seen in the screenshot, the data isn't correct. It should be:


districtID softwareID data_elementID
----------------------------------------------------------------------------
395 409 43
395 409 8
396 409 43
396 409 8


Here is my insert code:

<?php
for ($x=0; $x<sizeof($_POST['districtID']); $x++) {
?>
<?php
$InsertQuery = new WA_MySQLi_Query($sdpc_i);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "district_data_elements";
$InsertQuery->bindColumn("districtID", "i", "".($_POST["districtID"][$x]) ."", "WA_DEFAULT");
$InsertQuery->bindColumn("softwareID", "i", ((isset($_POST['softwareID']))?$_POST['softwareID']:"") , "WA_NULL");
$InsertQuery->bindColumn("data_elementID", "i", "".($_POST["data_elementID"][$x]) ."", "WA_DEFAULT");
$InsertQuery->saveInSession("");
$InsertQuery->execute();
$InsertGoTo = "";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";
$InsertQuery->redirect($InsertGoTo);
?>
<?php
}
?>

All the form fields have this structure districtID[]

Any help would be appreciated. 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...