I have just tried it without the repeat region form but still get no db insert, it goes into the page fine but if I try to edit it I get a warning popup "Your page must contain form elements in a repeated region to use this interface" !
*****************************************
<?php require_once('../Connections/GoCreate.php'); ?>
<?php require_once("../WA_DataAssist/WA_AppBuilder_PHP.php"); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_GoCreate, $GoCreate);
$query_rs_DesignTypeDBAdd = "SELECT * FROM admin_media_type";
$rs_DesignTypeDBAdd = mysql_query($query_rs_DesignTypeDBAdd, $GoCreate) or die(mysql_error());
$row_rs_DesignTypeDBAdd = mysql_fetch_assoc($rs_DesignTypeDBAdd);
$totalRows_rs_DesignTypeDBAdd = mysql_num_rows($rs_DesignTypeDBAdd);
mysql_select_db($database_GoCreate, $GoCreate);
$query_rs_IncCheck = "SELECT * FROM des_res_type";
$rs_IncCheck = mysql_query($query_rs_IncCheck, $GoCreate) or die(mysql_error());
$row_rs_IncCheck = mysql_fetch_assoc($rs_IncCheck);
$totalRows_rs_IncCheck = mysql_num_rows($rs_IncCheck);?>
<?php
// WA DataAssist Multiple Inserts
if (($totalRows_rs_IncCheck == 0)) // Trigger
{
if (!session_id()) session_start();
$WA_loopedFields = array("");
$WA_connection = $GoCreate;
$WA_table = "des_res_type";
$WA_redirectURL = "";
if (function_exists("rel2abs")) $WA_redirectURL = $WA_redirectURL?rel2abs($WA_redirectURL,dirname(__FILE__)):"";
$WA_keepQueryString = false;
$WA_fieldNamesStr = "DESIGN_ID|TYPE";
$WA_columnTypesStr = "none,none,NULL|none,none,NULL";
$WA_insertIfNotBlank = "";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_GoCreate;
$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 = "".$_GET['D_ID'] ."" . "|" . "".$row_rs_DesignTypeDBAdd['MEDIA_TYPE'] ."";
$WA_fieldValues = explode("|", $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);
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
</body>
</html>
<?php
mysql_free_result($rs_DesignTypeDBAdd);
mysql_free_result($rs_IncCheck);
?>