close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Universal Email server behavior issue - can't add recordset to page.

Thread began 3/06/2014 12:16 pm by sandy170299 | Last modified 3/07/2014 11:05 am by Jason Byrnes | 785 views | 8 replies |

sandy170299

Universal Email server behavior issue - can't add recordset to page.

In the Universal Email dialog, for the Email Body, I am using Dreamweaver to manage my email body contents. However, when I add a recordset to the DW page that has been created, and save it, the recordset disappears. I need to have a recordset for formatting purposes, as I am also using an Insert Multiple Records server behavior, which is causing formatting issues.

When I click on the DW Edit icon, I see the following message:

"Any change to server side code above the <head> tag (such as new recordsets) must be added to the page containing the Universal Email server behavior."

My question is, should I add the server behavior to the first (main) page, or to this page, just NOT within the head tag? Hope this makes sense.

Thanks!

Sign in to reply to this post

Jason ByrnesWebAssist

the recordset should be created on the page that you are adding the universal email behavior to, not the page that you use to define the body.

Sign in to reply to this post

sandy170299

Okay - thanks. Too much complicated formatting to use the Repeat Selection behavior.

Sign in to reply to this post

sandy170299

Jason, my insert script is not working. My date fields. It's inserting the date values into the database as 0000-00-00. Here is the code.

<?php
// WA DataAssist Multiple Inserts
if (isset($_POST["submit"]) || isset($_POST["submit_x"])) // Trigger
{
if (!session_id()) session_start();
$WA_loopedFields = array("day_of_week", "cost_code", "job_number", "hours");
$WA_connection = $PowerCMSConnection;
$WA_table = "employee_hours2";
$WA_redirectURL = "";
if (function_exists("rel2abs")) $WA_redirectURL = $WA_redirectURL?rel2abs($WA_redirectURL,dirname(__FILE__)):"";
$WA_keepQueryString = false;
$WA_fieldNamesStr = "employee_name|employee_number|week_starting|week_ending|day_of_week|cost_code|job_number|hours";
$WA_columnTypesStr = "',none,''|',none,''|',none,NULL|',none,NULL|',none,''|',none,''|',none,''|',none,''";
$WA_insertIfNotBlank = "day_of_week";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_PowerCMSConnection;
$WA_multipleInsertCounter = 0;
mysql_select_db($WA_connectionDB, $WA_connection);
while (WA_AB_checkMultiInsertLoopedFieldsExist($WA_loopedFields, $WA_multipleInsertCounter)) {
if ($WA_insertIfNotBlank == "" || WA_AB_checkLoopedFieldsNotBlank(array($WA_insertIfNotBlank), $WA_multipleInsertCounter)) {
$WA_fieldValuesStr = "".((isset($_POST["employee_name"]))?$_POST["employee_name"]:"") ."" . $WA_AB_Split . "".((isset($_POST["employee_number"]))?$_POST["employee_number"]:"") ."" . $WA_AB_Split . "".((isset($_POST["pick-date-start"]))?$_POST["pick-date-start"]:"") ."" . $WA_AB_Split . "".((isset($_POST["pick-date-end"]))?$_POST["pick-date-end"]:"") ."" . $WA_AB_Split . "".WA_AB_getLoopedFieldValue("day_of_week", $WA_multipleInsertCounter) ."" . $WA_AB_Split . "".WA_AB_getLoopedFieldValue("cost_code", $WA_multipleInsertCounter) ."" . $WA_AB_Split . "".WA_AB_getLoopedFieldValue("job_number", $WA_multipleInsertCounter) ."" . $WA_AB_Split . "".WA_AB_getLoopedFieldValue("hours", $WA_multipleInsertCounter) ."";
$WA_fieldValues = explode($WA_AB_Split, $WA_fieldValuesStr);
$insertParamsObj = WA_AB_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
$WA_Sql = "INSERT INTO `" . $WA_table . "` (" . $insertParamsObj->WA_tableValues . ") VALUES (" . $insertParamsObj->WA_dbValues . ")";
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
}
$WA_multipleInsertCounter++;
}
if ($WA_redirectURL != "") {
if ($WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
$WA_redirectURL .= ((strpos($WA_redirectURL, '?') === false)?"?":"&").$_SERVER["QUERY_STRING"];
}
header("Location: ".$WA_redirectURL);
}
}
?>

Sign in to reply to this post

Jason ByrnesWebAssist

dates need to be co\nverted to yyyy-mm-dd h:i:s format in order to be stored in a my sql database


in the insert behavior, when you select the binding for a data column, the code will look like:

<?php ((isset($_POST["pick-date-start"]))?$_POST["pick-date-start"]:""); ?>


you need to edit that to format the date:
<?php ((isset($_POST["pick-date-start"]))?date("Y-m-d h:i:s", strtotime($_POST["pick-date-start"])):""); ?>

Sign in to reply to this post

sandy170299

I'm using the WA Date Picker. What if I format the date to be yyyy/mm/dd to begin with? Will that work?

Sign in to reply to this post

Jason ByrnesWebAssist

No, when the date goes into the database, it needs to be in the format:
yyyy-mm-dd h:i:s

use the code example i provided to format the selected date to the format that will be accepted by the mySQL server.

Sign in to reply to this post

sandy170299

Why doesn't the WA insert extension do that for us? Can this be on the wish list? After all, it only works with PHP now, so can that be built in as a default date format? :D

Sign in to reply to this post

Jason ByrnesWebAssist

It is not a feature of the insert behavior.


feel free to add a product suggestion to our suggestions page:
http://www.webassist.com/community/feedback/dashboard.php

but for now, you will have to do it manually.

Sign in to reply to this post

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