close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

page not updating until refreshed

Thread began 5/14/2009 2:59 pm by roby258376 | Last modified 5/21/2009 3:34 pm by roby258376 | 2293 views | 10 replies |

roby258376

page not updating until refreshed

Hi folks,

I have followed the instructions in the tutorials for creating a profile update page that allows a user to upload a new picture.

I've used security assist, data assist and digital file pro to accomplish this.

I have the page set to go back to itself after the update, but when I test it, I don't see the update until after I refresh the page. The information changes in the database without a problem but the page is not auto refreshing when the submit button is pressed.

is there a setting I should change to make sure the user is seeing the updated profile? after submit, without having to force a refresh?

Thanks

Sign in to reply to this post

Ray BorduinWebAssist

Make sure the recordset occurs below the update code. That way it will be updated by the time you get the data.

Sign in to reply to this post

roby258376

Sorry Ray, I'm a bit new to this, and what I tried didn't work at all, so I'm posting my code, hoping you can see the error, or what I should move where.

Thanks in advance, you know, I don't know what we'd do without your expertise!

<?php
if (!isset($_SESSION)) {
session_start();
}
?>
<?php require_once('Connections/members.php'); ?>
<?php require_once( "WA_SecurityAssist/Helper_PHP.php" );

?>
<?php require_once("WA_DataAssist/WA_AppBuilder_PHP.php"); ?>
<?php require_once("WA_DigitalFilePro/HelperPHP.php"); ?>

<?php
if (!WA_Auth_RulePasses("Logged in to members")){
WA_Auth_RestrictAccess("members_LogIn.php?notLogged=true");
}

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
$ParamUserID_WAATKmembers = "-1";
if (isset($_SESSION['UserID'])) {
$ParamUserID_WAATKmembers = (get_magic_quotes_gpc()) ? $_SESSION['UserID'] : addslashes($_SESSION['UserID']);
}
mysql_select_db($database_members, $members);
$query_WAATKmembers = sprintf("SELECT * FROM members WHERE UserID = %s", $ParamUserID_WAATKmembers);
$WAATKmembers = mysql_query($query_WAATKmembers, $members) or die(mysql_error());
$row_WAATKmembers = mysql_fetch_assoc($WAATKmembers);
$totalRows_WAATKmembers = mysql_num_rows($WAATKmembers);

mysql_select_db($database_members, $members);
$query_rsPP = "SELECT * FROM yesno";
$rsPP = mysql_query($query_rsPP, $members) or die(mysql_error());
$row_rsPP = mysql_fetch_assoc($rsPP);
$totalRows_rsPP = mysql_num_rows($rsPP);

mysql_select_db($database_members, $members);
$query_rsProvince = "SELECT * FROM province_state";
$rsProvince = mysql_query($query_rsProvince, $members) or die(mysql_error());
$row_rsProvince = mysql_fetch_assoc($rsProvince);
$totalRows_rsProvince = mysql_num_rows($rsProvince);

mysql_select_db($database_members, $members);
$query_rsMemberStatus = "SELECT * FROM member_status";
$rsMemberStatus = mysql_query($query_rsMemberStatus, $members) or die(mysql_error());
$row_rsMemberStatus = mysql_fetch_assoc($rsMemberStatus);
$totalRows_rsMemberStatus = mysql_num_rows($rsMemberStatus);

mysql_select_db($database_members, $members);
$query_rsBusCat = "SELECT * FROM business_category";
$rsBusCat = mysql_query($query_rsBusCat, $members) or die(mysql_error());
$row_rsBusCat = mysql_fetch_assoc($rsBusCat);
$totalRows_rsBusCat = mysql_num_rows($rsBusCat);

mysql_select_db($database_members, $members);
$query_rsCommittees = "SELECT * FROM committee_names";
$rsCommittees = mysql_query($query_rsCommittees, $members) or die(mysql_error());
$row_rsCommittees = mysql_fetch_assoc($rsCommittees);
$totalRows_rsCommittees = mysql_num_rows($rsCommittees);?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if(isset($_POST["Update_x"])){
WA_DFP_UploadFile("WA_UploadResult1", "pictureFile", "".((isset($_POST["picture"]))?$_POST["picture"]:"") ."", "images/members/", "[FileName]", "2", "[FileName]_[Increment]", "0", "true", "125", "0");
}?>
<?php
// WA Application Builder Update
if ($_SERVER["REQUEST_METHOD"] == "POST") // Trigger
{
$WA_connection = $members;
$WA_table = "members";
$WA_redirectURL = "members_Profile.php";
$WA_keepQueryString = false;
$WA_indexField = "UserID";
$WA_fieldNamesStr = "userName|password|lastName|firstName|member_status|company|title|address|city|province_state|pc_zip|telephone|fax|cell_phone|url|business_category|picture|committee_ID|committee_2_ID";
$WA_fieldValuesStr = "".((isset($_POST["userName"]))?$_POST["userName"]:"") ."" . "|" . "".((isset($_POST["password"]))?$_POST["password"]:"") ."" . "|" . "".((isset($_POST["lastName"]))?$_POST["lastName"]:"") ."" . "|" . "".((isset($_POST["firstName"]))?$_POST["firstName"]:"") ."" . "|" . "".((isset($_POST["member_status"]))?$_POST["member_status"]:"") ."" . "|" . "".((isset($_POST["company"]))?$_POST["company"]:"") ."" . "|" . "".((isset($_POST["title"]))?$_POST["title"]:"") ."" . "|" . "".((isset($_POST["address"]))?$_POST["address"]:"") ."" . "|" . "".((isset($_POST["city"]))?$_POST["city"]:"") ."" . "|" . "".((isset($_POST["province_state"]))?$_POST["province_state"]:"") ."" . "|" . "".((isset($_POST["pc_zip"]))?$_POST["pc_zip"]:"") ."" . "|" . "".((isset($_POST["telephone"]))?$_POST["telephone"]:"") ."" . "|" . "".((isset($_POST["fax"]))?$_POST["fax"]:"") ."" . "|" . "".((isset($_POST["cell_phone"]))?$_POST["cell_phone"]:"") ."" . "|" . "".((isset($_POST["url"]))?$_POST["url"]:"") ."" . "|" . "".((isset($_POST["business_category"]))?$_POST["business_category"]:"") ."" . "|" . "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."" . "|" . "".((isset($_POST["committee_ID"]))?$_POST["committee_ID"]:"") ."" . "|" . "".((isset($_POST["committee_2_ID"]))?$_POST["committee_2_ID"]:"") ."";
$WA_columnTypesStr = "',none,''|',none,''|',none,''|',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 = "".$row_WAATKmembers['UserID'] ."";
$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_members;
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);
}
}
?>
Sign in to reply to this post

Ray BorduinWebAssist

It should be:

<?php
if (!isset($_SESSION)) {
session_start();
}
?>
<?php require_once('Connections/members.php'); ?>
<?php require_once( "WA_SecurityAssist/Helper_PHP.php" );

?>
<?php require_once("WA_DataAssist/WA_AppBuilder_PHP.php"); ?>
<?php require_once("WA_DigitalFilePro/HelperPHP.php"); ?>

<?php
if (!WA_Auth_RulePasses("Logged in to members")){
WA_Auth_RestrictAccess("members_LogIn.php?notLogged=true");
}
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if(isset($_POST["Update_x"])){
WA_DFP_UploadFile("WA_UploadResult1", "pictureFile", "".((isset($_POST["picture"]))?$_POST["picture"]:"") ."", "images/members/", "[FileName]", "2", "[FileName]_[Increment]", "0", "true", "125", "0");
}?>
<?php
// WA Application Builder Update
if ($_SERVER["REQUEST_METHOD"] == "POST") // Trigger
{
$WA_connection = $members;
$WA_table = "members";
$WA_redirectURL = "members_Profile.php";
$WA_keepQueryString = false;
$WA_indexField = "UserID";
$WA_fieldNamesStr = "userName|password|lastName|firstName|member_status|company|title|address|city|province_state|pc_zip|telephone|fax|cell_phone|url|business_category|picture|committee_ID|committee_2_ID";
$WA_fieldValuesStr = "".((isset($_POST["userName"]))?$_POST["userName"]:"") ."" . "|" . "".((isset($_POST["password"]))?$_POST["password"]:"") ."" . "|" . "".((isset($_POST["lastName"]))?$_POST["lastName"]:"") ."" . "|" . "".((isset($_POST["firstName"]))?$_POST["firstName"]:"") ."" . "|" . "".((isset($_POST["member_status"]))?$_POST["member_status"]:"") ."" . "|" . "".((isset($_POST["company"]))?$_POST["company"]:"") ."" . "|" . "".((isset($_POST["title"]))?$_POST["title"]:"") ."" . "|" . "".((isset($_POST["address"]))?$_POST["address"]:"") ."" . "|" . "".((isset($_POST["city"]))?$_POST["city"]:"") ."" . "|" . "".((isset($_POST["province_state"]))?$_POST["province_state"]:"") ."" . "|" . "".((isset($_POST["pc_zip"]))?$_POST["pc_zip"]:"") ."" . "|" . "".((isset($_POST["telephone"]))?$_POST["telephone"]:"") ."" . "|" . "".((isset($_POST["fax"]))?$_POST["fax"]:"") ."" . "|" . "".((isset($_POST["cell_phone"]))?$_POST["cell_phone"]:"") ."" . "|" . "".((isset($_POST["url"]))?$_POST["url"]:"") ."" . "|" . "".((isset($_POST["business_category"]))?$_POST["business_category"]:"") ."" . "|" . "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."" . "|" . "".((isset($_POST["committee_ID"]))?$_POST["committee_ID"]:"") ."" . "|" . "".((isset($_POST["committee_2_ID"]))?$_POST["committee_2_ID"]:"") ."";
$WA_columnTypesStr = "',none,''|',none,''|',none,''|',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 = "".$row_WAATKmembers['UserID'] ."";
$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_members;
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);
}
}
?>
<?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
$ParamUserID_WAATKmembers = "-1";
if (isset($_SESSION['UserID'])) {
$ParamUserID_WAATKmembers = (get_magic_quotes_gpc()) ? $_SESSION['UserID'] : addslashes($_SESSION['UserID']);
}
mysql_select_db($database_members, $members);
$query_WAATKmembers = sprintf("SELECT * FROM members WHERE UserID = %s", $ParamUserID_WAATKmembers);
$WAATKmembers = mysql_query($query_WAATKmembers, $members) or die(mysql_error());
$row_WAATKmembers = mysql_fetch_assoc($WAATKmembers);
$totalRows_WAATKmembers = mysql_num_rows($WAATKmembers);

mysql_select_db($database_members, $members);
$query_rsPP = "SELECT * FROM yesno";
$rsPP = mysql_query($query_rsPP, $members) or die(mysql_error());
$row_rsPP = mysql_fetch_assoc($rsPP);
$totalRows_rsPP = mysql_num_rows($rsPP);

mysql_select_db($database_members, $members);
$query_rsProvince = "SELECT * FROM province_state";
$rsProvince = mysql_query($query_rsProvince, $members) or die(mysql_error());
$row_rsProvince = mysql_fetch_assoc($rsProvince);
$totalRows_rsProvince = mysql_num_rows($rsProvince);

mysql_select_db($database_members, $members);
$query_rsMemberStatus = "SELECT * FROM member_status";
$rsMemberStatus = mysql_query($query_rsMemberStatus, $members) or die(mysql_error());
$row_rsMemberStatus = mysql_fetch_assoc($rsMemberStatus);
$totalRows_rsMemberStatus = mysql_num_rows($rsMemberStatus);

mysql_select_db($database_members, $members);
$query_rsBusCat = "SELECT * FROM business_category";
$rsBusCat = mysql_query($query_rsBusCat, $members) or die(mysql_error());
$row_rsBusCat = mysql_fetch_assoc($rsBusCat);
$totalRows_rsBusCat = mysql_num_rows($rsBusCat);

mysql_select_db($database_members, $members);
$query_rsCommittees = "SELECT * FROM committee_names";
$rsCommittees = mysql_query($query_rsCommittees, $members) or die(mysql_error());
$row_rsCommittees = mysql_fetch_assoc($rsCommittees);
$totalRows_rsCommittees = mysql_num_rows($rsCommittees);?>

Sign in to reply to this post

roby258376

Hi Ray,

I reworked the code, as you suggested, and I've pasted it below. Still not working though, now it doesn't update the db at all. Is there something else I'm missing?

<?php
if (!isset($_SESSION)) {
session_start();
}
?>
<?php require_once('Connections/members.php'); ?>
<?php require_once( "WA_SecurityAssist/Helper_PHP.php" );

?>
<?php require_once("WA_DataAssist/WA_AppBuilder_PHP.php"); ?>
<?php require_once("WA_DigitalFilePro/HelperPHP.php"); ?>

<?php
if (!WA_Auth_RulePasses("Logged in to members")){
WA_Auth_RestrictAccess("members_LogIn.php?notLogged=true");
}
?>


<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if(isset($_POST["Update_x"])){
WA_DFP_UploadFile("WA_UploadResult1", "pictureFile", "".((isset($_POST["picture"]))?$_POST["picture"]:"") ."", "images/members/", "[FileName]", "2", "[FileName]_[Increment]", "0", "true", "125", "0");
}?>

<?php
// WA Application Builder Update
if (isset($_POST["Update_x"])) // Trigger
{
$WA_connection = $members;
$WA_table = "members";
$WA_redirectURL = "members_Profile.php";
$WA_keepQueryString = false;
$WA_indexField = "UserID";
$WA_fieldNamesStr = "userName|password|lastName|firstName|member_status|company|title|address|city|province_state|pc_zip|telephone|fax|cell_phone|url|business_category|picture|committee_ID|committee_2_ID";
$WA_fieldValuesStr = "".((isset($_POST["userName"]))?$_POST["userName"]:"") ."" . "|" . "".((isset($_POST["password"]))?$_POST["password"]:"") ."" . "|" . "".((isset($_POST["lastName"]))?$_POST["lastName"]:"") ."" . "|" . "".((isset($_POST["firstName"]))?$_POST["firstName"]:"") ."" . "|" . "".((isset($_POST["member_status"]))?$_POST["member_status"]:"") ."" . "|" . "".((isset($_POST["company"]))?$_POST["company"]:"") ."" . "|" . "".((isset($_POST["title"]))?$_POST["title"]:"") ."" . "|" . "".((isset($_POST["address"]))?$_POST["address"]:"") ."" . "|" . "".((isset($_POST["city"]))?$_POST["city"]:"") ."" . "|" . "".((isset($_POST["province_state"]))?$_POST["province_state"]:"") ."" . "|" . "".((isset($_POST["pc_zip"]))?$_POST["pc_zip"]:"") ."" . "|" . "".((isset($_POST["telephone"]))?$_POST["telephone"]:"") ."" . "|" . "".((isset($_POST["fax"]))?$_POST["fax"]:"") ."" . "|" . "".((isset($_POST["cell_phone"]))?$_POST["cell_phone"]:"") ."" . "|" . "".((isset($_POST["url"]))?$_POST["url"]:"") ."" . "|" . "".((isset($_POST["business_category"]))?$_POST["business_category"]:"") ."" . "|" . "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."" . "|" . "".((isset($_POST["committee_ID"]))?$_POST["committee_ID"]:"") ."" . "|" . "".((isset($_POST["committee_2_ID"]))?$_POST["committee_2_ID"]:"") ."";
$WA_columnTypesStr = "',none,''|',none,''|',none,''|',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 = "".$row_WAATKmembers['UserID'] ."";
$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_members;
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);
}
}
?>





<?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
$ParamUserID_WAATKmembers = "-1";
if (isset($_SESSION['UserID'])) {
$ParamUserID_WAATKmembers = (get_magic_quotes_gpc()) ? $_SESSION['UserID'] : addslashes($_SESSION['UserID']);
}
mysql_select_db($database_members, $members);
$query_WAATKmembers = sprintf("SELECT * FROM members WHERE UserID = %s", $ParamUserID_WAATKmembers);
$WAATKmembers = mysql_query($query_WAATKmembers, $members) or die(mysql_error());
$row_WAATKmembers = mysql_fetch_assoc($WAATKmembers);
$totalRows_WAATKmembers = mysql_num_rows($WAATKmembers);

mysql_select_db($database_members, $members);
$query_rsPP = "SELECT * FROM yesno";
$rsPP = mysql_query($query_rsPP, $members) or die(mysql_error());
$row_rsPP = mysql_fetch_assoc($rsPP);
$totalRows_rsPP = mysql_num_rows($rsPP);

mysql_select_db($database_members, $members);
$query_rsProvince = "SELECT * FROM province_state";
$rsProvince = mysql_query($query_rsProvince, $members) or die(mysql_error());
$row_rsProvince = mysql_fetch_assoc($rsProvince);
$totalRows_rsProvince = mysql_num_rows($rsProvince);

mysql_select_db($database_members, $members);
$query_rsMemberStatus = "SELECT * FROM member_status";
$rsMemberStatus = mysql_query($query_rsMemberStatus, $members) or die(mysql_error());
$row_rsMemberStatus = mysql_fetch_assoc($rsMemberStatus);
$totalRows_rsMemberStatus = mysql_num_rows($rsMemberStatus);

mysql_select_db($database_members, $members);
$query_rsBusCat = "SELECT * FROM business_category";
$rsBusCat = mysql_query($query_rsBusCat, $members) or die(mysql_error());
$row_rsBusCat = mysql_fetch_assoc($rsBusCat);
$totalRows_rsBusCat = mysql_num_rows($rsBusCat);

mysql_select_db($database_members, $members);
$query_rsCommittees = "SELECT * FROM committee_names";
$rsCommittees = mysql_query($query_rsCommittees, $members) or die(mysql_error());
$row_rsCommittees = mysql_fetch_assoc($rsCommittees);
$totalRows_rsCommittees = mysql_num_rows($rsCommittees);?>
Sign in to reply to this post

Ray BorduinWebAssist

All we did is move the update code higher on the page. I can't imagine how that would make it stop working.

Do you get an error? Anything else you might have changed? Changing the order of the code is unlikely to make it stop working, expecially moving it up should just make it run that much sooner, so it is difficult to imagine that being the cause of it not working now.

Sign in to reply to this post

roby258376

Hi Ray,

I don't get an error, the page seems to do it's thing but the db is not updated and when the page reloads the change is not there.

There was one thing I changed, which I assumed would be ok.

In my orignal code, 2 of the blocks of code you had me move were surrounded by the same php tags <?php ?> Since you indicated they needed to be split, I added the ending tag to the first block and an opening tag to the second block, creating 2 seperate blocks. ie.

<?php
if (!isset($_SESSION)) {
session_start();
}
?>
<?php require_once('Connections/members.php'); ?>
<?php require_once( "WA_SecurityAssist/Helper_PHP.php" );

?>
<?php require_once("WA_DataAssist/WA_AppBuilder_PHP.php"); ?>
<?php require_once("WA_DigitalFilePro/HelperPHP.php"); ?>

<?php
if (!WA_Auth_RulePasses("Logged in to members")){
WA_Auth_RestrictAccess("members_LogIn.php?notLogged=true");
}


**********
you had me split the code here and insert the WA_DFP_SetupUploadStatusStruct and WA Application Builder Update code. essentially moving the next chunk of code down, so I ended the code block above with ?> and added a <?php tag to the next chunk.
**************

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;
}
}
?>
Sign in to reply to this post

Ray BorduinWebAssist

It shouldn't matter if code is broken into one two or more blocks.

I would use die() statements to debug what is happenning. It seems like it would work if it worked before. No errors? Does it redirect? Did you update the button on the page by any chance?

Sign in to reply to this post

roby258376

Didn't touch the button, didn't do anything other than reorder the code. I'm redirecting back to the same page, so when a user updates their profile they see the profile page again but with the new data. Worked before except the page didn't refresh and needed to be refreshed manually. Now it's just not updating at all.

Can you point me in the direction of a die statement to debug? I'm kind of new to this.

Thanks

Sign in to reply to this post

Ray BorduinWebAssist

Do you still have a copy of the page that was working and just needed a refresh?

Let's start over with that. Then post a support incident on the WebAssist web site. It will allow you to share your files in a private forum and somebody can help you directly.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...