close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Do not show if recordset is empty

Thread began 11/28/2011 7:01 am by superpac250441 | Last modified 12/01/2011 12:15 am by superpac250441 | 3352 views | 8 replies |

superpac250441

Do not show if recordset is empty

Hi there,
I was hoping that my Tabbed menu would leave out an item if the recordset was empty.

eg:

<?php if ($totalRows_rsContent > 0) { // Show if recordset not empty ?>
<li><span><a href="<?php echo $row_rsContent['Standardsurl']; ?>"><?php echo $row_rsContent['TabStandards']; ?></a></span></li><?php } // Show if recordset not empty ?>

Unfortunately the left and right curved pics of the tabs shows. (see attached picture - red arrow). Is there another way I can do this so it closes up?

Thanks

Sign in to reply to this post

superpac250441

Any chance of a response?

Sign in to reply to this post

Jason ByrnesWebAssist

please send a copy of the menu.php page so i can see this code in context, judging by the screen shot, all i can really guess is that there is a row being returned with a blank value.


what do you get if you change:
<?php if ($totalRows_rsContent > 0) { // Show if recordset not empty ?>

to:
<?php if ($totalRows_rsContent > 0) { // Show if recordset not empty ?>Rows: <?php echo($totalRows_rsContent); ?>

Sign in to reply to this post

superpac250441

Hi Jason,

Attached is the menu. Any help much appreciated!

I presume from what you suggested, I do this: (?)

<?php if ($totalRows_rsContent > 0) { // Show if recordset not empty ?>
<li><span><a href="<?php echo $row_rsContent['Standardsurl']; ?>"><?php echo $row_rsContent['TabStandards']; ?></a></span></li>
<?php echo($totalRows_rsContent); ?>

I get syntax error. Let me know if you need anything else.

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

Jason ByrnesWebAssist

the file you attached was the menu.css file. i need the menu.php file to see the php code.


No, that's not what I asked you to do.

I asked you to change:
<?php if ($totalRows_rsContent > 0) { // Show if recordset not empty ?>

to:
<?php if ($totalRows_rsContent > 0) { // Show if recordset not empty ?>Rows: <?php echo($totalRows_rsContent); ?>

and post back a screen shot of the results.

Sign in to reply to this post

superpac250441

Humblest apologies Jason. Next time I will wear my glasses Here it is attached - menu.php.
I will try your code and send a snapshot separately

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

superpac250441

Hi again Jason,
Here is the menu.php file with your code added plus a snapshot of the menu with your code. I trust I have got it right this time. The red arrow points to the empty recordset

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

Jason ByrnesWebAssist

i dont think you want to be checking if the recordset is empty, i think you want to be checking if the column for the menu item is empty:

php:
<?php if ($row_rsContent['Manualurl'] != "") {  ?>
<li><span><a href="http://www.bamr.co.za/<?php echo $row_rsContent['Manualurl']; ?>" target="_blank"><?php echo $row_rsContent['TabManual']; ?></a></span></li>
<?php }  ?>
Sign in to reply to this post

superpac250441

Fantastic Jason, GREATLY appreciated!!!!

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