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

When I apply a MySQLi Manage Relational Table behavior, it is somehow applying an old function

Thread began 4/17/2019 3:29 pm by TroyD | Last modified 4/30/2019 5:21 pm by TroyD | 186 views | 28 replies

TroyD

Thanks Ray, that worked great as well.

I have the behaviors in this order.

Update (for all the other details being updated for this product).
Delete (binds $_GET[‘ProductID’] to the Parent_ProductID column in the relational table).
Insert (binds the multi-select array post to the Parent_DepartmentID in the relational table).

This is what I did for the preselect. Please let me know if there is a better way.

I created another recordset that queries the current applied department categories from the relational table. Then I nested it within the while loop of the recordset that populates the multi-select so that I could use it to compare the category ids, selecting all that are already applied.

php:
<select name="u_DepartmentCategory[]" multiple="multiple" id="u_DepartmentCategory" required>

  <option disabled value>Select Category</option>
  <?php
while(!$rsDepartmentCategories->atEnd()) { //dyn select
?>
  <?php
$rsPreselectCategories 
= new WA_MySQLi_RS("rsPreselectCategories",$dbPRODUCTSi,0);
$rsPreselectCategories->setQuery("SELECT Parent_ProductID, Parent_DepartmentCategoryID FROM relDepartment_Products WHERE Parent_DepartmentCategoryID = ? AND Parent_ProductID = ?");
$rsPreselectCategories->bindParam("i""".($rsDepartmentCategories->getColumnVal("DepartmentCategoryID"))  ."""-1"); //ParamCatID2
$rsPreselectCategories->bindParam("i""".$_GET['ProductID']  ."""-1"); //ParamProdID2
$rsPreselectCategories->execute();
?>
  <option value="<?php echo($rsDepartmentCategories->getColumnVal("DepartmentCategoryID")); ?>"<?php if (!(strcmp($rsDepartmentCategories->getColumnVal("DepartmentCategoryID"), ($rsPreselectCategories->getColumnVal("Parent_DepartmentCategoryID"))))) {echo "selected=\"selected\"";} ?>><?php echo($rsDepartmentCategories->getColumnVal("DepartmentCategoryName")); ?></option>
  <?php
$rsDepartmentCategories
->moveNext();
//dyn select
$rsDepartmentCategories->moveFirst();
?>
</select>


Quick question…so what is the MRT specifically used for now? I have other pages to update that use the older MRT. Are there cases where I should continue with it or simply change to this simpler method?

Thanks,
TroyD

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