its confusing now. lets go step by step. currently on my update page this is my update behaviour code:
<?php
// WA Application Builder Update
if (isset($_POST["Update"])) // Trigger
{
$WA_connection = $con1;
$WA_table = "blog";
$WA_redirectURL = "admin.php";
if (function_exists("rel2abs")) $WA_redirectURL = $WA_redirectURL?rel2abs($WA_redirectURL,dirname(__FILE__)):"";
$WA_keepQueryString = false;
$WA_indexField = "permalink";
$WA_fieldNamesStr = "title|short_description|long_description|img|img_thumb|img2|img3|date|month|year|author|category|editor|ref|keywords|permalink";
$WA_fieldValuesStr = "".((isset($_POST["title"]))?$_POST["title"]:"") ."" . "|" . "".((isset($_POST["short_description"]))?$_POST["short_description"]:"") ."" . "|" . "".((isset($_POST["long_description"]))?$_POST["long_description"]:"") ."" . "|" . "".((isset($_POST["img"]))?$_POST["img"]:"") ."" . "|" . "".((isset($_POST["img_thumb"]))?$_POST["img_thumb"]:"") ."" . "|" . "".((isset($_POST["img2"]))?$_POST["img2"]:"") ."" . "|" . "".((isset($_POST["img3"]))?$_POST["img3"]:"") ."" . "|" . "".((isset($_POST["date"]))?$_POST["date"]:"") ."" . "|" . "".((isset($_POST["month"]))?$_POST["month"]:"") ."" . "|" . "".((isset($_POST["year"]))?$_POST["year"]:"") ."" . "|" . "".((isset($_POST["author"]))?$_POST["author"]:"") ."" . "|" . "".((isset($_POST["category"]))?$_POST["category"]:"") ."" . "|" . "".((isset($_POST["editor"]))?$_POST["editor"]:"") ."" . "|" . "".((isset($_POST["ref"]))?$_POST["ref"]:"") ."" . "|" . "".((isset($_POST["keywords"]))?$_POST["keywords"]:"") ."" . "|" . "".((isset($_POST["title"]))?$_POST["title"]:"") ."";
$WA_columnTypesStr = "',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',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["title"]))?$_POST["title"]:"") ."";
$WA_where_columnTypesStr = "',none,''";
$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_con1;
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);
}
}
?>