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

INSERT/UPDATE form - how to combine 5 form field to submit to one database field? Datetime

Thread began 9/26/2014 3:12 am by Nathon Jones Web Design | Last modified 10/01/2014 9:22 am by Nathon Jones Web Design | 647 views | 14 replies

Nathon Jones Web Design

Originally Said By: Nathon Jones Web Design
  The sample code you've provided, to reformat the date when it is submitted...does that go above the Insert code or is that held within the body section?  

Originally Said By: Jason Byrnes
  it goes before the insert  

Have inserted the following before the Insert, but it's not inserting in the correct format and seems to be defaulting to 1970-01-01 00:00:00

if(isset($_POST['ADDEVENTPICKER'])) {
$_POST['ADDEVENTPICKER'] = date("Y-m-d", strtotime($_POST['ADDEVENTPICKER']));

if (isset($_POST["formADDEVENTBTN"]) || isset($_POST["formADDEVENTBTN_x"])) {
$InsertQuery = new WA_MySQLi_Query($SMTmysqli);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "SMTevents";
$InsertQuery->bindColumn("SMTeventtitle", "s", "".((isset($_POST["SMTeventtitle"]))?$_POST["SMTeventtitle"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMTeventdesc", "s", "".((isset($_POST["SMTeventdesc"]))?$_POST["SMTeventdesc"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMTeventdate", "t", "".((isset($_POST["ADDEVENTPICKER"]))?$_POST["ADDEVENTPICKER"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMTeventtime", "s", "".((isset($_POST["SMTeventtime"]))?$_POST["SMTeventtime"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMTvenueID", "i", "".((isset($_POST["SMTeventvenue"]))?$_POST["SMTeventvenue"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMTeventimg", "s", "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."", "WA_DEFAULT");
$InsertGoTo = "add-event-confirm.php";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";

Here's the Datepicker code:
<link type="text/css" href="../webassist/datepicker/add-event_datepicker_1/jquery-ui.css" rel="stylesheet" />
<script src=""></script>
<script src="//"></script>
<script type="text/javascript">
function closeDatePicker_datepicker_1() {
var tElm = $('#datepicker_1');
if (typeof datepicker_1_Spry != null && typeof datepicker_1_Spry != "undefined" && ADDEVENTPICKER_Spry.validate) {
var docElm = document.getElementById("datepicker_1");
var tBlur = docElm.getAttribute("onBlur");
if (!tBlur) tBlur = docElm.getAttribute("onblur");
if (!tBlur) tBlur = docElm.getAttribute("ONBLUR");
if (tBlur) {
tBlur = String(tBlur).replace(/\bthis\b/g, "docElm");

And the Datepicker form field...

<div class="form-group">
<label for="ADDEVENTPICKER" class="col-sm-2 control-label">Date:</label>
<div class="col-sm-10">
<input id="datepicker_1" name="ADDEVENTPICKER" type="text" placeholder="Click here to select a date" />
</div><!-- col-sm-10 -->
</div><!-- end form-group -->

I've attached the page also, for inspection. 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





Ease of use


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