Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Hide Mutliple Records with dreamweaver show records behavior

Posted on 2011-10-31
8
Medium Priority
?
349 Views
Last Modified: 2012-06-21
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.
0
Comment
Question by:mikemike12
  • 4
  • 4
8 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 37057143
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
 

Author Comment

by:mikemike12
ID: 37057291
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
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 37057344
Okay, how much PHP do you know?
0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 

Author Comment

by:mikemike12
ID: 37057496
I can read it and understand it.  I make too many errors when I try to write it.  It drives me nuts.  
0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 2000 total points
ID: 37057858
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
 

Author Comment

by:mikemike12
ID: 37058459
absolutely makes sense.  I'll give it a try tonight.
0
 

Author Closing Comment

by:mikemike12
ID: 37059511
this is pretty nice.  Do you guys always respond this quickly?  Do you support dreamweaver, php, javascript, and sql
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 37059860
>> 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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Suggested Courses
Course of the Month12 days, 6 hours left to enroll

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question