Nearly There
Ok I changed all the the id fields in my whole database
e.g.
person_id to personID
and this appears to have fixed the sql Param errors.
However I am still having the following issue.
1. My update_page does not redirect to the detail page as specified.
2. My insert_page does not redirect to the results page. the page just refreshes after insert.
Do I need to check the checkbox "pass original query string" in the insert record behaviour for the pages to redirect?
code snippet for update page
// WA Application Builder Insert
if (isset($_POST["Insert_x"])) // Trigger
{
$WA_connection = $connElite;
$WA_table = "companies";
$WA_sessionName = "WADA_Insert_companies";
$WA_redirectURL = "admin/companies_Detail.php";
$WA_keepQueryString = false;
$WA_indexField = "companyID";
$WA_fieldNamesStr = "company_name|company_address|company_city|company_postcode|company_telephone|company_email|company_fax|company_contact_firstname|company_contact_lastname|company_mobile|salutationID|company_category|company_information";
$WA_fieldValuesStr = "".((isset($_POST["company_name"]))?$_POST["company_name"]:"") ."" . "|" . "".((isset($_POST["company_address"]))?$_POST["company_address"]:"") ."" . "|" . "".((isset($_POST["company_city"]))?$_POST["company_city"]:"") ."" . "|" . "".((isset($_POST["company_postcode"]))?$_POST["company_postcode"]:"") ."" . "|" . "".((isset($_POST["company_telephone"]))?$_POST["company_telephone"]:"") ."" . "|" . "".((isset($_POST["company_email"]))?$_POST["company_email"]:"") ."" . "|" . "".((isset($_POST["company_fax"]))?$_POST["company_fax"]:"") ."" . "|" . "".((isset($_POST["company_contact_firstname"]))?$_POST["company_contact_firstname"]:"") ."" . "|" . "".((isset($_POST["company_contact_lastname"]))?$_POST["company_contact_lastname"]:"") ."" . "|" . "".((isset($_POST["company_mobile"]))?$_POST["company_mobile"]:"") ."" . "|" . "".((isset($_POST["salutationID"]))?$_POST["salutationID"]:"") ."" . "|" . "".((isset($_POST["company_category"]))?$_POST["company_category"]:"") ."" . "|" . "".((isset($_POST["company_information"]))?$_POST["company_information"]:"") ."";
$WA_columnTypesStr = "',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|none,none,NULL|',none,''|',none,''";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_connElite;
mysql_select_db($WA_connectionDB, $WA_connection);
if (!session_id()) session_start();
$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());
$_SESSION[$WA_sessionName] = mysql_insert_id();
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);
}
}
?>
I manually prepended admin/ in the redirect code because my pages are in the this subdirectory. This did not help.
$WA_redirectURL = "admin/companies_Detail.php";
I even tried putting the abousolute url of the site, as I am testing directly on my remote server, but this didnt work either. I am completely lost?