Additional Issue
Hello,
The insert behaviour is not showing in the Server Behavior list. Why is this? What needs to change to make it recognized and allow GUI editing?
Here is the code as found. Note I did remove the blank lines as a test and that still did not allow the insert behavior to show in the Server Behavior list...
<?php
// WA Application Builder Update
if (isset($_POST["Update"])) // Trigger
{
$WA_connection = $PowerCMSConnection;
$WA_table = "pcms2_contents";
$WA_redirectURL = "".(isset($_GET['returnPage'])?$_GET['returnPage']:"index.php");
$WA_keepQueryString = false;
$WA_indexField = "ContentID";
$WA_fieldNamesStr = "ContentGroup|ContentRefID|ContentValue";
$WA_fieldValuesStr = "".((isset($_POST["ContentGroup"]))?$_POST["ContentGroup"]:"") ."" . "|" . "".((isset($_POST["ContentRefID"]))?$_POST["ContentRefID"]:"") ."" . "|" . "".((isset($_POST["ContentValue"]))?$_POST["ContentValue"]:"") ."";
$WA_columnTypesStr = "',none,''|',none,''|',none,''";
$WA_comparisonStr = "=|=|=";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_where_fieldValuesStr = "".((isset($_POST["WADAUpdateRecordID"]))?$_POST["WADAUpdateRecordID"]:"") ."";
$WA_where_columnTypesStr = "none,none,NULL";
$WA_where_comparisonStr = "=";
$WA_where_fieldNames = explode("|", $WA_indexField);
$WA_where_fieldValues = explode("|", $WA_where_fieldValuesStr);
$WA_where_columns = explode("|", $WA_where_columnTypesStr);
$WA_where_comparisons = explode("|", $WA_where_comparisonStr);
$WA_connectionDB = $database_PowerCMSConnection;
mysql_select_db($WA_connectionDB, $WA_connection);
if (!session_id()) session_start();
$updateParamsObj = WA_AB_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
$WhereObj = WA_AB_generateWhereClause($WA_where_fieldNames, $WA_where_columns, $WA_where_fieldValues, $WA_where_comparisons );
$WA_Sql = "UPDATE `" . $WA_table . "` SET " . $updateParamsObj->WA_setValues . " WHERE " . $WhereObj->sqlWhereClause . "";
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
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);
}
}
?>