close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Details page problem displaying extra data

Thread began 10/05/2010 2:41 pm by Brad Lawryk | Last modified 10/12/2010 9:57 pm by agmichaca | 1791 views | 22 replies |

Brad Lawryk

Details page problem displaying extra data

I have a set of Data assist pages built and they work great.

However I need to add extra data from different tables to the detail page. For example my details page shows my client profile no problem that is from the client table in the database.

I have an additional table for client notes where the administrator can enter extra notes on the particular client and I need to be able to display all the notes on that client in the profile page.

When I add the recordset to the detail page the page crashes. Now this should be a very simple thing to do as I have done it a zillion times on a non-webassist detail page.

Is there something special that is required to do this?

Brad

Sign in to reply to this post

neilo

I had a recurring problem in CS3 & CS4, when adding a second recordset (or even editing the first and only one) whereby a duplicate block of code got added to the page. Every time.

Check your page code to make sure you only have one instance of:

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



If there is more than one such block, then delete the extra lines.

CS5 seems to have resolved this issue.

Sign in to reply to this post

Brad Lawryk

"CS5 seems to have resolved this issue."

I am using CS5 ... but I'll give that a try

Sign in to reply to this post

Brad Lawryk

No, I still get an error and error in the code.

On the page it says:

Parse error: parse error in C:\wamp\www\dashboard\_staff\employers\clients_Detail.php on line 63

the code error is in these lines:

$Paramclient_id_WADAclients = "-1";
if (isset()) {
$Paramclient_id_WADAclients = (get_magic_quotes_gpc()) ? : addslashes();
}
$Paramclient_id2_WADAclients = "-1";
if (isset()) {
$Paramclient_id2_WADAclients = (get_magic_quotes_gpc()) ? : addslashes();
}
$ParamSessionclient_id_WADAclients = "-1";
if (isset()) {
$ParamSessionclient_id_WADAclients = (get_magic_quotes_gpc()) ? : addslashes();
}

Sign in to reply to this post

neilo

I don't know what's going wrong here.

The session variable values appear to be missing from that code. Based on what you have posted, I would expect your code to look more like:

$Paramclient_id_WADAclients = "-1";
if (isset($_GET['client_id'])) {
$Paramclient_id_WADAclients = (get_magic_quotes_gpc()) ? : addslashes();
}
$Paramclient_id2_WADAclients = "-1";
if (isset($_GET['client_id']))) {
$Paramclient_id2_WADAclients = (get_magic_quotes_gpc()) ? : addslashes();
}
$ParamSessionclient_id_WADAclients = "-1";
if (isset($_SESSION['WADA_Insert_clientst']))) {
$ParamSessionclient_id_WADAclients = (get_magic_quotes_gpc()) ? : addslashes();
}



I am not reliable as far as php goes, so Jason or Ray would need to confirm.

Sign in to reply to this post

Brad Lawryk

And it really makes no difference what recordset I set up. I tried with just a plain one field test table with no filtering and no sorting .... same thing.

Sign in to reply to this post

Dani Chankhour

Do you get the same result if you removed DataAssist or do you always get that issue.

Sign in to reply to this post

Brad Lawryk

Originally Said By: Dani Chankhour
  Do you get the same result if you removed DataAssist or do you always get that issue.  



Only happens on the Data Assist Detail page. Even if I just create a recordset that has nothing to do with the page (no filtering or sort order). And just to see if it was something on the page I went to a different site that I have Data Assist on and the same thing happens on the Data Assist Detail page on a completely different site.

Brad

Sign in to reply to this post

Brad Lawryk

Originally Said By: Dani Chankhour
  Do you get the same result if you removed DataAssist or do you always get that issue.  



I have included the before and after code as well as a screenshot of the lines with errors.

Screenshot: codeerror.jpg

------------- Code before adding a record set: -----------

<?php
$Paramclient_id_WADAclients = "-1";
if (isset($_GET['client_id'])) {
$Paramclient_id_WADAclients = (get_magic_quotes_gpc()) ? $_GET['client_id'] : addslashes($_GET['client_id']);
}
$ParamSessionclient_id_WADAclients = "-1";
if (isset($_SESSION['WADA_Insert_clients'])) {
$ParamSessionclient_id_WADAclients = (get_magic_quotes_gpc()) ? $_SESSION['WADA_Insert_clients'] : addslashes($_SESSION['WADA_Insert_clients']);
}
$Paramclient_id2_WADAclients = "-1";
if (isset($_GET['client_id'])) {
$Paramclient_id2_WADAclients = (get_magic_quotes_gpc()) ? $_GET['client_id'] : addslashes($_GET['client_id']);
}
mysql_select_db($database_connKoparDashboard, $connKoparDashboard);
$query_WADAclients = sprintf("SELECT client_id, client_random, client_last, client_first, client_phone, client_message, client_cell, client_email, client_street, client_mailing, client_city, client_prov, client_postalcode, client_birth, client_gender, client_sin, client_maritial, client_visminor, client_aborig, client_disability, client_office, client_date, client_password, client_stafffirst, client_stafflast FROM clients WHERE client_id = %s OR ( -1= %s AND client_id= %s)", GetSQLValueString($Paramclient_id_WADAclients, "int"),GetSQLValueString($Paramclient_id2_WADAclients, "int"),GetSQLValueString($ParamSessionclient_id_WADAclients, "int"));
$WADAclients = mysql_query($query_WADAclients, $connKoparDashboard) or die(mysql_error());
$row_WADAclients = mysql_fetch_assoc($WADAclients);
$totalRows_WADAclients = mysql_num_rows($WADAclients);

if("" == ""){
$WA_mainMenu_1 = new WA_Include("../../_subs/mainMenu.php");
require($WA_mainMenu_1->BaseName);
$WA_mainMenu_1->Initialize(true);
}

if("" == ""){
$WA_footer_1 = new WA_Include("../../_subs/footer.php");
require($WA_footer_1->BaseName);
$WA_footer_1->Initialize(true);
}
?>

------------------ Code after adding a record set: -----------------

<?php
$Paramclient_WADAclients = "-1";
if (isset($_GET['client_id'])) {
$Paramclient_WADAclients = (get_magic_quotes_gpc()) ? $_GET['client_id'] : addslashes($_GET['client_id']);
}
$ParamSessionclient_WADAclients = "-1";
if (isset($_SESSION['WADA_Insert_clients'])) {
$ParamSessionclient_WADAclients = (get_magic_quotes_gpc()) ? $_SESSION['WADA_Insert_clients'] : addslashes($_SESSION['WADA_Insert_clients']);
}
$Paramclient_WADAclients = "-1";
if (isset($_GET['client_id'])) {
$Paramclient_WADAclients = (get_magic_quotes_gpc()) ? $_GET['client_id'] : addslashes($_GET['client_id']);
}
$Paramclient_id_WADAclients = "-1";
if (isset()) {
$Paramclient_id_WADAclients = (get_magic_quotes_gpc()) ? : addslashes();
}
$Paramclient_id2_WADAclients = "-1";
if (isset()) {
$Paramclient_id2_WADAclients = (get_magic_quotes_gpc()) ? : addslashes();
}
$ParamSessionclient_id_WADAclients = "-1";
if (isset()) {
$ParamSessionclient_id_WADAclients = (get_magic_quotes_gpc()) ? : addslashes();
}
mysql_select_db($database_connKoparDashboard, $connKoparDashboard);
$query_WADAclients = sprintf("SELECT client_id, client_random, client_last, client_first, client_phone, client_message, client_cell, client_email, client_street, client_mailing, client_city, client_prov, client_postalcode, client_birth, client_gender, client_sin, client_maritial, client_visminor, client_aborig, client_disability, client_office, client_date, client_password, client_stafffirst, client_stafflast FROM clients WHERE client_id = %s OR ( -1= %s AND client_id= %s)", GetSQLValueString($Paramclient_id_WADAclients, "int"),GetSQLValueString($Paramclient_id2_WADAclients, "int"),GetSQLValueString($ParamSessionclient_id_WADAclients, "int"));
$WADAclients = mysql_query($query_WADAclients, $connKoparDashboard) or die(mysql_error());
$row_WADAclients = mysql_fetch_assoc($WADAclients);
$totalRows_WADAclients = mysql_num_rows($WADAclients);

$colname_rsClientComments = "-1";
if (isset($_GET['client_id'])) {
$colname_rsClientComments = (get_magic_quotes_gpc()) ? $_GET['client_id'] : addslashes($_GET['client_id']);
}
mysql_select_db($database_connKoparDashboard, $connKoparDashboard);
$query_rsClientComments = sprintf("SELECT * FROM clientscomments WHERE clientcom_id = %s ORDER BY clientcom_date DESC", GetSQLValueString($colname_rsClientComments, "int"));
$rsClientComments = mysql_query($query_rsClientComments, $connKoparDashboard) or die(mysql_error());
$row_rsClientComments = mysql_fetch_assoc($rsClientComments);
$totalRows_rsClientComments = mysql_num_rows($rsClientComments);

if("" == ""){
$WA_mainMenu_1 = new WA_Include("../../_subs/mainMenu.php");
require($WA_mainMenu_1->BaseName);
$WA_mainMenu_1->Initialize(true);
}

if("" == ""){
$WA_footer_1 = new WA_Include("../../_subs/footer.php");
require($WA_footer_1->BaseName);
$WA_footer_1->Initialize(true);
}
?>

Sign in to reply to this post

Willi Schneider

Hi Brad

I've experienced these issues when using "_" underscores in my column names like "client_id".
Could you try to duplicate your table, just for testing, but avoid underscores for the table and column names? --> Then try your WADA pages again.
I know, you were also on the "Interakt train" a long time ago...
Interakt always used column names like "id_usr" and so on.
I think, DataAssist just doesn't like that naming convention.

HTH

Willi

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