The update post fails too, and shows errors on lines 90 and 99: Is the problem with the URL redirect?
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home***/pcswdc.org/test/library.php:106) in /home/***/pcswdc.org/test/library_Update.php on line 90
Warning: Cannot modify header information - headers already sent by (output started at /home/***/pcswdc.org/test/library.php:106) in /home/***/pcswdc.org/test/library_Update.php on line 99
<?php require_once('../Connections/research_library.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;
}
}
?>
<?php
$Parampk_reslib_id_WADAlibrary = "-1";
if (isset($_GET['pk_reslib_id'])) {
$Parampk_reslib_id_WADAlibrary = (get_magic_quotes_gpc()) ? $_GET['pk_reslib_id'] : addslashes($_GET['pk_reslib_id']);
}
mysql_select_db($database_research_library, $research_library);
$query_WADAlibrary = sprintf("SELECT pk_reslib_id, title, author_first_name_01, author_last_name_01, author_first_name_02, author_last_name_02, author_first_name_03, author_last_name_03, publisher, year, isbn, description, keywords, city, edition, format, type, language FROM library WHERE pk_reslib_id = %s", GetSQLValueString($Parampk_reslib_id_WADAlibrary, "int"));
$WADAlibrary = mysql_query($query_WADAlibrary, $research_library) or die(mysql_error());
$row_WADAlibrary = mysql_fetch_assoc($WADAlibrary);
$totalRows_WADAlibrary = mysql_num_rows($WADAlibrary);?>
<?php
// WA Application Builder Update
if (isset($_POST["Update_x"])) // Trigger
{
$WA_connection = $research_library;
$WA_table = "library";
$WA_redirectURL = "library_Detail.php?pk_reslib_id=".((isset($_POST["WADAUpdateRecordID"]))?$_POST["WADAUpdateRecordID"]:"") ."";
if (function_exists("rel2abs")) $WA_redirectURL = $WA_redirectURL?rel2abs($WA_redirectURL,dirname(__FILE__)):"";
$WA_keepQueryString = false;
$WA_indexField = "pk_reslib_id";
$WA_fieldNamesStr = "title|author_first_name_01|author_last_name_01|author_first_name_02|author_last_name_02|author_first_name_03|author_last_name_03|publisher|year|isbn|description|keywords|city|edition|format|type|language";
$WA_fieldValuesStr =
"".((isset($_POST["title"]))?$_POST["title"]:"") ."" . "|" .
"".((isset($_POST["author_first_name_01"]))?$_POST["author_first_name_01"]:"") ."" . "|" .
"".((isset($_POST["author_last_name_01"]))?$_POST["author_last_name_01"]:"") ."" . "|" .
"".((isset($_POST["author_first_name_02"]))?$_POST["author_first_name_02"]:"") ."" . "|" .
"".((isset($_POST["author_last_name_02"]))?$_POST["author_last_name_02"]:"") ."" . "|" .
"".((isset($_POST["author_first_name_03"]))?$_POST["author_first_name_03"]:"") ."" . "|" .
"".((isset($_POST["author_last_name_03"]))?$_POST["author_last_name_03"]:"") ."" . "|" .
"".((isset($_POST["publisher"]))?$_POST["publisher"]:"") ."" . "|" .
"".((isset($_POST["year"]))?$_POST["year"]:"") ."" . "|" .
"".((isset($_POST["isbn"]))?$_POST["isbn"]:"") ."" . "|" .
"".((isset($_POST["description"]))?$_POST["description"]:"") ."" . "|" .
"".((isset($_POST["keywords"]))?$_POST["keywords"]:"") ."" . "|" .
"".((isset($_POST["city"]))?$_POST["city"]:"") ."" . "|" .
"".((isset($_POST["edition"]))?$_POST["edition"]:"") ."" . "|" .
"".((isset($_POST["format"]))?$_POST["format"]:"") ."" . "|" .
"".((isset($_POST["type"]))?$_POST["type"]:"") ."" . "|" .
"".((isset($_POST["language"]))?$_POST["language"]:"") ."";
$WA_columnTypesStr = "',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''";
$WA_comparisonStr = " LIKE | LIKE | LIKE | LIKE | LIKE | LIKE | LIKE | LIKE | LIKE | LIKE | LIKE | LIKE | LIKE | LIKE | LIKE | LIKE | LIKE ";
$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_research_library;
mysql_select_db($WA_connectionDB, $WA_connection);
//LINE 90
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"];
}
//LINE 99
header("Location: ".$WA_redirectURL);
}
}
?>