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

Multiple Select List

Thread began 9/25/2010 7:23 am by Cologne | Last modified 9/27/2010 11:55 am by Cologne | 1801 views | 18 replies

Dave BuchholzBeta Tester

Yes it all handled by DA, it puts these code blocks at the top of the page

php:
<?php

// WA DataAssist Manage Relational Table 1
if (isset($_POST["updateNow"])) // Trigger
{
  
$WA_arrayOrFieldList 0;
  
$WA_joinLoopedField "categories";
  
$WA_loopedField "";
  
$WA_connection $connDB;
  
$WA_table "tbl_lnkproductcategories";
  
$WA_redirectURL "";
  
$WA_keepQueryString false;
  
$WA_masterKeyField "products";
  
$WA_masterKeyType "none,none,NULL";
  
$WA_masterKeyValue "".$row_rsDetailView['id']  ."";
  
$WA_masterKeyComp "=";
  
$WA_joinedKeyField "categories";
  
$WA_joinedKeyType "none,none,NULL";
  
$WA_joinedKeyComp "=";
  
$WA_fieldNamesStr "products|categories";
  
$WA_columnTypesStr "none,none,NULL|none,none,NULL";
  
$WA_appliedString "";
  
$WA_appliedList = array();
  
$WA_valuesList = array();
  
$WA_connectionDB $database_connDB;
  
mysql_select_db($WA_connectionDB$WA_connection);
  if (
$WA_arrayOrFieldList == 0) {
    
$WA_loopedValues $_POST[$WA_joinLoopedField];
    for (
$v=0$v<sizeof($WA_loopedValues); $v++) {
      
$WA_fieldValues "^MASTERID^" "|" "^JOINID^";
      
$WA_valuesList[] = array($WA_loopedValues[$v], $WA_fieldValues);
      
$WA_appliedString .= "^" $WA_loopedValues[$v] . "^";
      
$WA_appliedList[] = $WA_loopedValues[$v];
    }
  }
  else if (
$WA_arrayOrFieldList == 1) {
    
$WA_mrtLoopCounter 0;
    while (
WA_AB_checkLoopedFieldsExist(array($WA_loopedField), $WA_mrtLoopCounter)) {
      if (
WA_AB_checkLoopedFieldsNotBlank(array($WA_joinLoopedField), $WA_mrtLoopCounter) && WA_AB_getLoopedFieldValue($WA_loopedField$WA_mrtLoopCounter) == WA_AB_getLoopedFieldValue($WA_joinLoopedField$WA_mrtLoopCounter)) {
        
$WA_fieldValues "^MASTERID^" "|" "^JOINID^";
        
$WA_valuesList[] = array(WA_AB_getLoopedFieldValue($WA_loopedField$WA_mrtLoopCounter), $WA_fieldValues);
        
$WA_appliedString .= "^" WA_AB_getLoopedFieldValue($WA_loopedField$WA_mrtLoopCounter) . "^";
        
$WA_appliedList[] = WA_AB_getLoopedFieldValue($WA_loopedField$WA_mrtLoopCounter);
      }
      
$WA_mrtLoopCounter++;
    }
  }
  
WA_AB_doManageRelationalTable($WA_valuesList$WA_appliedString$WA_appliedList$WA_connection$WA_table$WA_masterKeyField$WA_masterKeyType$WA_masterKeyValue$WA_masterKeyComp$WA_joinedKeyField$WA_joinedKeyType$WA_joinedKeyComp$WA_fieldNamesStr$WA_columnTypesStr);
  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 Manage Relational Table 2
if (isset($_POST["updateNow"])) // Trigger
{
  
$WA_arrayOrFieldList 0;
  
$WA_joinLoopedField "prodtypes";
  
$WA_loopedField "";
  
$WA_connection $connDB;
  
$WA_table "tbl_lnkproductprodtypes";
  
$WA_redirectURL "";
  
$WA_keepQueryString false;
  
$WA_masterKeyField "products";
  
$WA_masterKeyType "none,none,NULL";
  
$WA_masterKeyValue "".$row_rsDetailView['id']  ."";
  
$WA_masterKeyComp "=";
  
$WA_joinedKeyField "prodtypes";
  
$WA_joinedKeyType "none,none,NULL";
  
$WA_joinedKeyComp "=";
  
$WA_fieldNamesStr "products|prodtypes";
  
$WA_columnTypesStr "none,none,NULL|none,none,NULL";
  
$WA_appliedString "";
  
$WA_appliedList = array();
  
$WA_valuesList = array();
  
$WA_connectionDB $database_connDB;
  
mysql_select_db($WA_connectionDB$WA_connection);
  if (
$WA_arrayOrFieldList == 0) {
    
$WA_loopedValues $_POST[$WA_joinLoopedField];
    for (
$v=0$v<sizeof($WA_loopedValues); $v++) {
      
$WA_fieldValues "^MASTERID^" "|" "^JOINID^";
      
$WA_valuesList[] = array($WA_loopedValues[$v], $WA_fieldValues);
      
$WA_appliedString .= "^" $WA_loopedValues[$v] . "^";
      
$WA_appliedList[] = $WA_loopedValues[$v];
    }
  }
  else if (
$WA_arrayOrFieldList == 1) {
    
$WA_mrtLoopCounter 0;
    while (
WA_AB_checkLoopedFieldsExist(array($WA_loopedField), $WA_mrtLoopCounter)) {
      if (
WA_AB_checkLoopedFieldsNotBlank(array($WA_joinLoopedField), $WA_mrtLoopCounter) && WA_AB_getLoopedFieldValue($WA_loopedField$WA_mrtLoopCounter) == WA_AB_getLoopedFieldValue($WA_joinLoopedField$WA_mrtLoopCounter)) {
        
$WA_fieldValues "^MASTERID^" "|" "^JOINID^";
        
$WA_valuesList[] = array(WA_AB_getLoopedFieldValue($WA_loopedField$WA_mrtLoopCounter), $WA_fieldValues);
        
$WA_appliedString .= "^" WA_AB_getLoopedFieldValue($WA_loopedField$WA_mrtLoopCounter) . "^";
        
$WA_appliedList[] = WA_AB_getLoopedFieldValue($WA_loopedField$WA_mrtLoopCounter);
      }
      
$WA_mrtLoopCounter++;
    }
  }
  
WA_AB_doManageRelationalTable($WA_valuesList$WA_appliedString$WA_appliedList$WA_connection$WA_table$WA_masterKeyField$WA_masterKeyType$WA_masterKeyValue$WA_masterKeyComp$WA_joinedKeyField$WA_joinedKeyType$WA_joinedKeyComp$WA_fieldNamesStr$WA_columnTypesStr);
  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 Pre-Select Relational Table 2
$WA_PreSelect_RelationalTable_2 = array();
$WA_connection $connDB;
$WA_table "tbl_lnkproductprodtypes";
$WA_masterKeyField "products";
$WA_masterKeyType "none,none,NULL";
$WA_masterKeyValue "".$row_rsDetailView['id']  ."";
$WA_masterKeyComp "=";
$WA_joinedKeyField "prodtypes";
$WA_connectionDB $database_connDB;
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];
  }
}
?>
<?php
// WA DataAssist Pre-Select Relational Table 1
$WA_PreSelect_RelationalTable_1 = array();
$WA_connection $connDB;
$WA_table "tbl_lnkproductcategories";
$WA_masterKeyField "products";
$WA_masterKeyType "none,none,NULL";
$WA_masterKeyValue "".$row_rsDetailView['id']  ."";
$WA_masterKeyComp "=";
$WA_joinedKeyField "categories";
$WA_connectionDB $database_connDB;
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_1[] = $row_WA_mrtJoinRS[$WA_joinedKeyField];
  }
}
?>



It's not the easiest part of DA to get your head around but once you do it is very powerful.

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