close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Rule to show text if no record found

Thread began 8/28/2014 4:54 pm by iainmacdonald331081 | Last modified 8/29/2014 11:35 am by Jason Byrnes | 698 views | 5 replies |

iainmacdonald331081

Rule to show text if no record found

I have a bit of text on a page to display a list of categories from a table, if the query returns any results using:

Allow if <?php echo $row_rsNominations['ScoreID']; ?> <> ''

But what would the rule be to display some text (e.g. 'This lodge has received no votes yet') if there are no matching records in the query?

I guess as there are no matching records I can't compare any fields - but presume this must be possible?

Sign in to reply to this post

Jason ByrnesWebAssist

Use the Show If recordset is empty server behavior.

Sign in to reply to this post

iainmacdonald331081

Thanks Jason - I thought there was one like that, but had misplaced it as I hadn't reinstalled the mySQLi extension after issues with the Extension Manager. (Although it might be somewhere else, pre mySQLi?)

So I have that reinstalled, and trying:

WA > mySQLi > Show Region > mySQLi Show If Recordset Is Empty / mySQLi Show If Recordset Is Not Empty

But I'm getting the error:

Before you using this server behavior, please create a recordset.

Even though the page does have recordsets. Copy attached below.

Sign in to reply to this post

Jason ByrnesWebAssist

your recordset is a standard MySQL recordset, so you need to use the standard show if recordset is not empty, not the MySQLi one.

Sign in to reply to this post

iainmacdonald331081

Thanks Jason - my mistake there was looking under WA for it - forgot it was one of the regular DW ones.

Although weirdly didn't want to work in code view, which was throwing up a message about having to select something first.

But was fine in design view.

Sign in to reply to this post

Jason ByrnesWebAssist

yeah, the show if behavior doesn't work correctly in code view.

glad to hear you have it working.

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