close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

déjà vu MRT and details page

Thread began 8/17/2011 5:27 pm by Jon Cunningham | Last modified 8/18/2011 10:08 am by Jon Cunningham | 1908 views | 7 replies |

Jon CunninghamBeta Tester

déjà vu MRT and details page

Hi Guys, May I trouble you for a little help with my users_details page.

I have created a database to hold customer information along with a MRT table for listing of different product brand names which are selected by way of tick boxes.

Main Table `brands`
BrandID
BrandName
BrandIcon

Joining Table `userbrand`
UserBrandID
UserBrandUserID
UserBrandBrandID

User table `users`
UserID
UserEmail
Username
etc etc.

I have successfully used repeat regions and MRT to pull the correct information into my insert and update pages and store them correctlty in the DB. Where I am falling down is when I come to coding the details page.

I have wriiten what I believe to be the correct Sql statement joing the respective tables for output on the details page of the brand names; but sadly I am close but not getting the cookies (Sorry Ernie you will have ask Burt for some cookies this time)

Both my insert and update pages work with MRT but I have 2 issues. On the update page it shows the tick boxes for all the products brands (retrieved from the DB) but they are missing the previous seletected ticks to the chosen brands from the insert page.

My second issue is my userDetails Page. I have no output to this page for the chosen brand names.

on the detail pages I :
Added recordset to page `rsBrands`

Added SQL
SELECT brand.BrandName, users.UserID
FROM brand INNER JOIN userbrand ON brand.BrandID = userbrand.UserBrandBrandID
INNER JOIN users ON userbrand.UserBrandUserID = users.UserID
WHERE users.UserID = paramUserID

My Param is as follows
paramUserID
Integrer
-1
$_GET['UserID']

Added echo statements on details page

<?php do { ?>
<?php echo $row_rsBrands['BrandName']; ?> <strong>|</strong>
<?php } while ($row_rsBrands = mysql_fetch_assoc($rsBrands)); ?>

I would be very great full if someone with good grounding could advise.

I will upload my insert / update and details.

So many thanks to all in advance

Jonathon

Attached Files
users_Update.zip
Sign in to reply to this post

Jason ByrnesWebAssist

Update Page: In the MRT Behaivor, the Master Key value should be using the UserID URL Variable instead of the WADA_Insert_users session variable.

Details Page:
in the rsBrands recordset, change the where clause:
WHERE users.UserID = paramUserID

to:
WHERE UserID = paramUserID OR ( -1= paramUserID2 AND UserID= paramSessionUserID)

and create the following variables:

Name: paramUserID
type: integer
default value: -1
Runtime Value: $_GET['UserID']

Name: paramUserID2
type: integer
default value: -1
Runtime Value: $_GET['UserID']

Name: paramSessionUserID
type: integer
default value: -1
Runtime Value: $_SESSION['WADA_Insert_users']

Sign in to reply to this post

Jon CunninghamBeta Tester

Hi Jason,

Thank you for coming to the rescue yet again.

Changes to the details page worked great.

However on the update page I am still not getting the tick boxes to populate from the database. If you have any idea's that i could try it would be very much appreciated.

Regards

Jonathon

Sign in to reply to this post

Jason ByrnesWebAssist

please send the latest copy of the update page.

Sign in to reply to this post

Jon CunninghamBeta Tester

Attached as requested.

Many thanks Jason

Sign in to reply to this post

Jon CunninghamBeta Tester

Sorry, here it is.

Attached Files
users_Update.zip
Sign in to reply to this post

Jason ByrnesWebAssist

the code for preselecting the options is duplicated,


delete the following code from lines 289 - 209:

php:
<?php

// WA DataAssist Pre-Select Relational Table 1
$WA_PreSelect_RelationalTable_1 = array();
$WA_connection $connFinder;
$WA_table "userbrand";
$WA_masterKeyField "UserBrandUserID";
$WA_masterKeyType "',none,''";
$WA_masterKeyValue "".$_SESSION['WADA_Insert_users']  ."";
$WA_masterKeyComp "=";
$WA_joinedKeyField "UserBrandBrandID";
$WA_connectionDB $database_connFinder;
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];
  }
}
?>
Sign in to reply to this post

Jon CunninghamBeta Tester

A VERY big Thank you

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