close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Weird update problem

Thread began 9/11/2011 12:05 pm by rik.forgo | Last modified 9/12/2011 7:29 am by Jason Byrnes | 1357 views | 2 replies |

rik.forgo

Weird update problem

I have successfully implemented Data Assist on two separate databases on two different areas of my client's website. It works well. The pages for search, results and details work fine.

But here's where the weirdness comes in. When I click through to either create a new record (in either database) or to update a record (again, in either database) the page loads properly, but it loads an empty iteration of the page's template file, and then the page that was formatted for the update/new record.

Take a look here:
library_Search.php

Search for Aztec, then click the Update link and you'll see what I mean.

I have walked backwards with this one, starting with just the raw code from the page when Dreamweaver created it from the template. The "page doubling" only occurs when I paste in the Data Assist code before the <!DOCTYPE tag. Once that code is inserted, the "page doubling" starts.

Any ideas what might be going on here?

Sign in to reply to this post

rik.forgo

Errors too

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);
}
}
?>

Sign in to reply to this post

Jason ByrnesWebAssist

  The "page doubling" only occurs when I paste in the Data Assist code before the <!DOCTYPE tag. Once that code is inserted, the "page doubling" starts.  



it sounds to me like you are pasting the code for the entire page, not just the insert or update record behavior.


the work flow should not include any copying from one page then pasting it to another.

If you are not using the wizard to create the pages, you should be creating the update form on your page, then applying the Up[date Record server behavior to it, I'm not sure why you are Copying code from one page to another, but that is likely the source of the page doubling and also of the headers already sent error.

Sign in to reply to this post

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...