Wrong db entry created
I have a file upload that resizes the image twice, one for the main photo and one for the thumbnail.
Both files are resized and uploaded correctly, however the file name for the thumbnail is repreated in both fields in the database.
I have tried the known issue fix by updating the helper.php file but this hasn't helped.
Any ideas?
<?php
// WA_UploadResult2 Params Start
$WA_UploadResult2_Params = array();
// WA_UploadResult2_2 Start
$WA_UploadResult2_Params["WA_UploadResult2_2"] = array(
'UploadFolder' => "../images/Album/Thumbnail/",
'FileName' => "[FileName]_thumb",
'DefaultFileName' => "",
'ResizeType' => "1",
'ResizeWidth' => "200",
'ResizeHeight' => "200",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult2_2 End
// WA_UploadResult2_1 Start
$WA_UploadResult2_Params["WA_UploadResult2_1"] = array(
'UploadFolder' => "../images/Album/Photos/",
'FileName' => "[FileName]_photo",
'DefaultFileName' => "",
'ResizeType' => "1",
'ResizeWidth' => "600",
'ResizeHeight' => "600",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult2_1 End
// WA_UploadResult2 Params End
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult2");
if(isset($_POST["Insert_x"])){
WA_DFP_UploadFiles("WA_UploadResult2", "album_img", "2", "[NewFileName]_[Increment]", "PNG:5", $WA_UploadResult2_Params);
}
?>
<?php
// WA Application Builder Insert
if (isset($_POST["Insert_x"])) // Trigger
{
$WA_connection = $k9sar;
$WA_table = "albums";
$WA_sessionName = "WADA_Insert_albums";
$WA_redirectURL = "albums_Detail.php";
if (function_exists("rel2abs")) $WA_redirectURL = $WA_redirectURL?rel2abs($WA_redirectURL,dirname(__FILE__)):"";
$WA_keepQueryString = false;
$WA_indexField = "id";
$WA_fieldNamesStr = "album_name|album_img|album_thumb|album_caption";
$WA_fieldValuesStr = "".((isset($_POST["album_name"]))?$_POST["album_name"]:"") ."" . "|" . "".$WA_DFP_UploadStatus["WA_UploadResult2"]["serverFileName"] ."" . "|" . "".$WA_DFP_UploadStatus["WA_UploadResult2"]["serverFileName"] ."" . "|" . "".((isset($_POST["album_caption"]))?$_POST["album_caption"]:"") ."";
$WA_columnTypesStr = "',none,''|',none,''|',none,''|',none,''";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_k9sar;
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);
}
}
?>