The problem is code order.
the image is using the SecurityAssistpcms2users recordsset:
<img src="../_images/userprofilethumb/<?php echo $row_SecurityAssistpcms2users['UserImage']; ?>" alt="Client Thumbnail Photo" name="cppmf100" width="50" height="50" id="cppmf100">Profile Photo
On the page, you have the recordset before the update behavior. move the code for the update behavior at lines 143 - 224:
<?php
// WA DataAssist Update
if ((isset($_POST["UserUpdate_submit"]) && $_POST["UserUpdate_submit"] != "")) // Trigger
{
$WA_connection = $mfaccessConn;
$WA_table = "pcms2_users";
$WA_redirectURL = "userupdate.php?success=1";
if (function_exists("rel2abs")) $WA_redirectURL = $WA_redirectURL?rel2abs($WA_redirectURL,dirname(__FILE__)):"";
$WA_keepQueryString = true;
$WA_indexField = "UserID";
$WA_fieldNamesStr = "UserEmail|UserPassword|UserFirstName|UserLastName|UserCity|UserState|UserZip|UserPhone|UserFax|UserCountry|UserAddress|UserAddress2|UserImage|UserThumbnail|emailVerified";
$WA_fieldValuesStr = "".((isset($_POST["User_Update_group_Email"]))?$_POST["User_Update_group_Email"]:"") ."" . $WA_AB_Split . "".((($_POST["User_Update_group_Password"] != ""))?WA_SHA1Encryption($_POST["User_Update_group_Password"]):$row_SecurityAssistpcms2users["UserPassword"]) ."" . $WA_AB_Split . "".((isset($_POST["User_Update_group_First_Name"]))?$_POST["User_Update_group_First_Name"]:"") ."" . $WA_AB_Split . "".((isset($_POST["User_Update_group_Last_Name"]))?$_POST["User_Update_group_Last_Name"]:"") ."" . $WA_AB_Split . "".((isset($_POST["User_Update_group_City"]))?$_POST["User_Update_group_City"]:"") ."" . $WA_AB_Split . "".((isset($_POST["User_Update_group_County"]))?$_POST["User_Update_group_County"]:"") ."" . $WA_AB_Split . "".((isset($_POST["User_Update_group_10_Post_Code"]))?$_POST["User_Update_group_10_Post_Code"]:"") ."" . $WA_AB_Split . "".((isset($_POST["User_Update_group_1_Telephone"]))?$_POST["User_Update_group_1_Telephone"]:"") ."" . $WA_AB_Split . "".((isset($_POST["User_Update_group_1_Mobile"]))?$_POST["User_Update_group_1_Mobile"]:"") ."" . $WA_AB_Split . "".((isset($_POST["User_Update_group_11_Country"]))?$_POST["User_Update_group_11_Country"]:"") ."" . $WA_AB_Split . "".((isset($_POST["User_Update_group_Address_1"]))?$_POST["User_Update_group_Address_1"]:"") ."" . $WA_AB_Split . "".((isset($_POST["User_Update_group_Address"]))?$_POST["User_Update_group_Address"]:"") ."" . $WA_AB_Split . "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."" . $WA_AB_Split . "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."" . $WA_AB_Split . "".(($row_SecurityAssistpcms2users['UserEmail'] != $_POST["User_Update_group_Email"])? '0': $row_SecurityAssistpcms2users['emailVerified']) ."";
$WA_columnTypesStr = "',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|none,none,NULL";
$WA_comparisonStr = "=|=|=|=|=|=|=|=|=|=|=|=|=|=|=";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode($WA_AB_Split, $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_where_fieldValuesStr = "".((isset($_SESSION["SecurityAssist_UserID"]))?$_SESSION["SecurityAssist_UserID"]:"") ."";
$WA_where_columnTypesStr = "none,none,NULL";
$WA_where_comparisonStr = "=";
$WA_where_fieldNames = explode("|", $WA_indexField);
$WA_where_fieldValues = explode($WA_AB_Split, $WA_where_fieldValuesStr);
$WA_where_columns = explode("|", $WA_where_columnTypesStr);
$WA_where_comparisons = explode("|", $WA_where_comparisonStr);
$WA_connectionDB = $database_mfaccessConn;
mysql_select_db($WA_connectionDB, $WA_connection);
@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);
}
}
?>
<?php
// WA DataAssist Update
if ((isset($_GET['send']) && $_GET['send'] != "")) // Trigger
{
$WA_connection = $mfaccessConn;
$WA_table = "pcms2_users";
$WA_redirectURL = "";
if (function_exists("rel2abs")) $WA_redirectURL = $WA_redirectURL?rel2abs($WA_redirectURL,dirname(__FILE__)):"";
$WA_keepQueryString = false;
$WA_indexField = "UserID";
$WA_fieldNamesStr = "UserImage|UserThumbnail|randomString";
$WA_fieldValuesStr = "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."" . $WA_AB_Split . "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."" . $WA_AB_Split . "".$_SESSION['rpw'] ."";
$WA_columnTypesStr = "',none,''|',none,''|',none,''";
$WA_comparisonStr = "=|=|=";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode($WA_AB_Split, $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_where_fieldValuesStr = "".$_SESSION['SecurityAssist_UserID'] ."";
$WA_where_columnTypesStr = "none,none,NULL";
$WA_where_comparisonStr = "=";
$WA_where_fieldNames = explode("|", $WA_indexField);
$WA_where_fieldValues = explode($WA_AB_Split, $WA_where_fieldValuesStr);
$WA_where_columns = explode("|", $WA_where_columnTypesStr);
$WA_where_comparisons = explode("|", $WA_where_comparisonStr);
$WA_connectionDB = $database_mfaccessConn;
mysql_select_db($WA_connectionDB, $WA_connection);
@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);
}
}
?>
to line 131 so the update is before the recordset.