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

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Manage Relational Table, retrieving data for update form fields

Thread began 11/01/2012 9:02 am by CraigR | Last modified 2/14/2013 5:30 am by CraigR | 563 views | 3 replies

CraigRBeta Tester

Manage Relational Table, retrieving data for update form fields

Don't know if this is possible via this method, but here goes.

I have a product with several related tables, for each of which i have added manage related tables server behavior.

Slightly more complex than the blue sky example, some related options have an associated price - which is dependent upon its productid, so the price field is in the many to many table.

my insert page is working fine, however, i cannot recover the price in the update page.

looking at the code, it looks like the mrt server behavior creates a block of code called WA DataAssist Pre-Select Relational Table (x) which is used to retrieve the optionid from the table, but i also want to recover the price.

i tried editing the code from

php:
<?php
// WA DataAssist Pre-Select Relational Table 2
$WA_PreSelect_RelationalTable_2 = array();
$WA_connection $simon;
$WA_table "tblproductcolour";
$WA_masterKeyField "ProductID";
$WA_masterKeyType "none,none,NULL";
$WA_masterKeyValue "".$_GET['ProductID']  ."";
$WA_masterKeyComp "=";
$WA_joinedKeyField "ColourID";
$WA_connectionDB $database_simon;
mysql_select_db($WA_connectionDB$WA_connection);
$WhereObj WA_AB_generateWhereClause(array($WA_masterKeyField), array($WA_masterKeyType), array($WA_masterKeyValue), array($WA_masterKeyComp));
$WA_Sql "SELECT ".$WA_masterKeyField.", ".$WA_joinedKeyField." FROM ".$WA_table." WHERE ".$WhereObj->sqlWhereClause." ORDER BY ".$WA_joinedKeyField;
$WA_mrtJoinRS mysql_query($WA_Sql$WA_connection) or die(mysql_error());
if (
mysql_num_rows($WA_mrtJoinRS) > 0) {
  while (
$row_WA_mrtJoinRS mysql_fetch_assoc($WA_mrtJoinRS)) {
    
$WA_PreSelect_RelationalTable_2[] = $row_WA_mrtJoinRS[$WA_joinedKeyField];
  }
}
?>



to

php:
<?php
// WA DataAssist Pre-Select Relational Table 2
$WA_PreSelect_RelationalTable_2 = array();
$WA_connection $simon;
$WA_table "tblproductcolour";
$WA_masterKeyField "ProductID";
$WA_masterKeyType "none,none,NULL";
$WA_masterKeyValue "".$_GET['ProductID']  ."";
$WA_masterKeyComp "=";
$WA_joinedKeyField "ColourID";
$WA_extraField "Price";
$WA_connectionDB $database_simon;
mysql_select_db($WA_connectionDB$WA_connection);
$WhereObj WA_AB_generateWhereClause(array($WA_masterKeyField), array($WA_masterKeyType), array($WA_masterKeyValue), array($WA_masterKeyComp));
$WA_Sql "SELECT ".$WA_masterKeyField.", ".$WA_joinedKeyField.", ".$WA_extraField." FROM ".$WA_table." WHERE ".$WhereObj->sqlWhereClause." ORDER BY ".$WA_joinedKeyField;
$WA_mrtJoinRS mysql_query($WA_Sql$WA_connection) or die(mysql_error());
if (
mysql_num_rows($WA_mrtJoinRS) > 0) {
  while (
$row_WA_mrtJoinRS mysql_fetch_assoc($WA_mrtJoinRS)) {
    
$WA_PreSelect_RelationalTable_2[] = $row_WA_mrtJoinRS[$WA_joinedKeyField];
  }
}
?>



adding the extra field price, so i can get the field into the 'recordset' , but can't work out how to set the value of my price text field.

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