Display "No Records Found" Message
6 posts by 2 authors in: Forums > CMS Builder
Last Post: April 8, 2008 (RSS)
By kcallana - March 31, 2008
Thanks!
Re: [kcallana] Display "No Records Found" Message
By Dave - March 31, 2008
<?php if ($listDetails['noRecordsFound']): ?>
No records were found!<br/>
(but replace this with your image tag!)
<?php endif ?>
If that's not working attach your viewer file and I can look at the code for you.
Hope that helps! :)
interactivetools.com
Re: [Dave] Display "No Records Found" Message
By kcallana - April 6, 2008
<?php endif ?>
<?php if (empty($record)): ?>
<!-- Display "No Records Found" Message -->
<img src="/images/holiday.png">
<?php endif ?>
not<?php if ($listDetails['noRecordsFound']): ?>
No records were found!<br/>
(but replace this with your image tag!)
<?php endif ?>
the page is www.lorenzos.net/index.php
Re: [kcallana] Display "No Records Found" Message
By Dave - April 6, 2008
If you could attach the file for index.php I could look at the viewer code and try and spot the problem.
Hope that helps!
interactivetools.com
Re: [Dave] Display "No Records Found" Message
By kcallana - April 7, 2008
index.php is attached
thanks!
Re: [kcallana] Display "No Records Found" Message
By Dave - April 8, 2008
Ok, so since the holiday specials section is a single-page section there will always be a record. So what we need to test is if one of your other fields is defined.
So we can use a PHP if statement for that and || which means "or". So I added this code:
<?php if ($record['title'] || $record['title_2'] || $record['title_3'] || $record['title_4']): ?>
... holiday specials are displayed here ...
<?php else: ?>
<img src="/images/holiday.png">
<?php endif ?>
Which basically means if any of those fields (title, title_2, title_3, title_4 isn't blank then show the holiday specials, otherwise they must all be blank so slow the holiday.png image which says check back another time.
You can see the page here (I didn't want to modify your original):
http://lorenzos.net/index2.php
Hope that helps!
interactivetools.com