Hide Mutliple Records with dreamweaver show records behavior

I'm using Dreamweaver and PHP.  I have data from 3 different tables that I'm trying to display on the same page.  Dreamweaver will only you apply the "show record if" behavior to one recordset at a time.  I need the same data to be displayed and respond to three different recordsets not just one. Any suggestions.
mikemike12Asked:
Who is Participating?
 
Jason C. LevineNo oneCommented:
Heh.  You'll get better.

So when you add a Show If Recordset Empty Behavior, the PHP is:

<?php if ($totalRows_rsYourRecordSet == 0) } ?>
 HTML here
<?php } ?>

Open in new window


and a Show If Not Empty Is:

<?php if ($totalRows_rsYourRecordSet > 0) } ?>
 HTML here
<?php } ?>

Open in new window


Breaking down the PHP, it's very simple.  You have a <?php ?> block that contains the beginning of a condition (an if statement) and opens the {.  If the condition is true, the HTML in between that opening block and the closing bracket (<?php } ?> ) is shown to the user.

So while the wizard only allows one recordset to be used at a time, you can EASILY modify the PHP to use more than one condition.  In your case, the message should show if both recordsets are empty.  That's a simple AND condition:

<?php if ($totalRows_rsYourRecordSet1 == 0 AND $totalRows_rsYourRecordSet2 == 0) } ?>
 HTML here
<?php } ?>

Open in new window


Make sense?
0
 
Jason C. LevineNo oneCommented:
You can't use the wizard to do it due to the restriction so you need to switch to code view and write your own PHP to handle it.

Can you give me an example of how it should work?
0
 
mikemike12Author Commented:
Yes.  Basically, I'd like it to work with conditions.  Let's say recordset 1 is empty. I use Show (my message) if recordset 1 is empty, if recordset 2 has data, then the message should not show because becuase even though recordset 1 is empty, recordset 2 has data.  The way it works now, recordset 1 can only discern the data in recordset 1 it can't react to recordset 2.  
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
Jason C. LevineNo oneCommented:
Okay, how much PHP do you know?
0
 
mikemike12Author Commented:
I can read it and understand it.  I make too many errors when I try to write it.  It drives me nuts.  
0
 
mikemike12Author Commented:
absolutely makes sense.  I'll give it a try tonight.
0
 
mikemike12Author Commented:
this is pretty nice.  Do you guys always respond this quickly?  Do you support dreamweaver, php, javascript, and sql
0
 
Jason C. LevineNo oneCommented:
>> Do you guys always respond this quickly

It varies depending on when and where you post.  Usually you get a response within a few hours of posting

>> Do you support dreamweaver, php, javascript, and sql

There are very few people who watch the Dreamweaver topic, but lots and lots who watch the PHP, MySQL, HTML, and Javascript zones.  When you post, cross post the question in multiple relevant zones for better responses.  We're loosely organized and all volunteers...this isn't like a help desk where we can all see each other.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.