close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Multiple Repeat regions and Recordsets question

Thread begun 5/04/2009 11:46 am by mustang_sally_85344510 | Last modified 7/27/2010 7:05 am by mustang_sally_85344510 | 9136 views | 7 replies |

mustang_sally_85344510

Multiple Repeat regions and Recordsets question

I am building a display page and it involves multiple repeat regions on the same page.

The display page... displays from a link.. "go to detail page" server behavior.

I am trying to display database information by visitorID ....
I am trying to get information from 4 tables....of the specific individual user,
using visitorID as the common variable connecting the 4 tables.

I cannot use the same recordset for all the repeat regions...
What would be the proper way to queery for the desired results?

Sign in to reply to this post

Danilo Celic

If you cannot use the same recordset for all of the repeats, then you can create a recordset for each repeat region and filter that recordset as appropriate. But, it's not really clear to me exactly what you're trying to do, so I may be missing something in your explanation.

Sign in to reply to this post

mustang_sally_85344510

Multi repeat regions

Hi again,

I have a page called "centers.php" that has a "go to detail page" link.
Which carries the "colname" to the centersdetail.php page.

On that detail page I want to have all of the information that that id number has submitted to the site. For example, tournaments, leagues, coupons, center. Filtered by visitorID

The problem is DW will not allow an additional repeat region server behavior. It only allows 1 repeat region from a recordset.

I have attached the revelent recordsets and pages,...hopefully you can see what I am doing wrong. Or should I say...what I should be doing.

I do get the first repeat region to work,...but cannot bring up the correct individual "colname" on the other recordset repeat regions.

Thank you in advance for any help and suggestions you can give me.

Sign in to reply to this post

Danilo Celic

Well a quick way to get this to work would be to create duplicate recordsets using the same settings. In fact with Recordsets, you can copy and paste them in the Server Behaviors panel. Select your recordset, right click, select copy, then right click and select Paste. You'll now have a new recordset. You can edit it to give it a name that you'll recognize better, if you feel like it. You can then use the "new" recordset as the one to repeat over for the Repeat Region you need to have on your page.

Or, you can "reset" the recordset back to the first result item, and then wrap the area you want to repeat with a copy of the Dreamweaver repeating code.

To reset your recordset back to the start of the recordset use code similar to the following (replace Recordset1 with the name of your recordset). This code will need to be inserted immediately above any repeat region you want to add, so if you have 5 repeat regions, then you'll have this on the page 4 times, no need to have it prior to the first one on the page, as the recordset is already at the beginning:

<?php
$rows = mysql_num_rows($Recordset1);
if($rows > 0) {
mysql_data_seek($Recordset1, 0);
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
}
?>

Then any region you want to repeat, add this before the start of the region:
<?php do { ?>

and this after (again replace Recordset1 with the name of your recordset):
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>

Sign in to reply to this post

mustang_sally_85344510

Still having problems here

Hello again,

I tried making one giant recordset and I couldn't get it to work properly.
It brought up inaccurate information.

I think one of my many problems is in the recordset ...

I need to change the criteria in the WHERE clause for each table.
For example:

WHERE centerId = colname AND centers.VisitorID = tourneyad.VisitorID
(for one table)
WHERE centerId = colname AND centers.VisitorID = leagues.VisitorID
(another table)
WHERE centerId = colname AND centers.VisitorID = coupon.VisitorID
(another table)

I tried using AND operator for one giant WHERE clause...and I need a situation where if a visitor doesn't have something in one of the other tables...it will still bring up their other entered information.

Thank you again, for your help.

Sign in to reply to this post

mustang_sally_85344510

I got it~!!!

HI THERE~:)

Thank you for all your help.

After responding to your help...
I discovered that I was putting too much info in my first (one to copy) recordset.

After I copied it...than made the adjustments in my WHERE clause.

It is working good so far.

Again, thank you for your posts and all your GREAT HELP! :)

Sign in to reply to this post

robert254422

Point to a specific record

<?php
$rows = mysql_num_rows($Recordset1);
if($rows > 0) {
mysql_data_seek($Recordset1, 0);
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
}
?>

This post has helped me a great deal... I was just wondering if this method could be used to NOT reset it all the way but point it to a specific row in the recordset... Say row 3... So you can have a repeat region of 3 on 1 part of the page and continue with the next 3 on a different part of the page?

I would like to have 5 repeat regions with say 3 records each on a page using 1 recordset and have each next repeat region start of where it left off at the other 1...

Is that possible with this method?

wkr

Sign in to reply to this post

mustang_sally_85344510

I would consider binding the information to the specific row you want the information and from whatever recordset.

I've combined information from different recordsets and applied a repeat region to it and haven't had any issues so far. :)

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