close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Need a single MySQLi drop down select list to insert multiple columns from one table into a form

Thread began 9/29/2014 7:27 am by Jason | Last modified 9/29/2014 12:43 pm by Jason | 7444 views | 20 replies

Jason

For example, the options in the drop down list are the contents of the event column (9am Service, 11am Service...). If "9am Service" is selected when the form is submitted, I need to enter the event_id (1), start_time (08:30:00), and end_time (10:30:00) for that record into 3 columns the on the table the form is inserting a record to (all based off of the 1 selection).

Here's what the insert looks like currently.

<?php
if ((((isset($_POST["Submit"]))?$_POST["Submit"]:"") != "")) {
$InsertQuery = new WA_MySQLi_Query($local_i);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "calendar_events";
$InsertQuery->bindColumn("name", "s", "".((isset($_POST["UserID"]))?$_POST["UserID"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("start_date", "s", "".((isset($_POST["start_date"]))?$_POST["start_date"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("end_date", "s", "".((isset($_POST["start_date"]))?$_POST["start_date"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("repeats", "s", "".((isset($_POST["RecurType"]))?$_POST["RecurType"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("repeat_every", "i", "".((isset($_POST["Frequency"]))?$_POST["Frequency"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("repeat_on", "i", "".((isset($_POST["RecurOn"]))?$_POST["RecurOn"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("occurrence", "s", "".((isset($_POST["Occurrence"]))?$_POST["Occurrence"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("occurrence_end", "s", "".((isset($_POST["ends_on"]))?$_POST["ends_on"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("type", "s", "person", "WA_DEFAULT");
$InsertQuery->bindColumn("attribute", "s", "".((isset($_POST["Room"]))?$_POST["Room"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("attribute_2", "s", "".((isset($_POST["Position"]))?$_POST["Position"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("calendar_id", "i", "1", "WA_DEFAULT");
$InsertQuery->saveInSession("");
$InsertQuery->execute();
$InsertGoTo = "eventcal.php";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";
$InsertQuery->redirect($InsertGoTo);
}
?>



I may be severely over complicating this, but for some reason I can't seem to wrap my head around it.

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...