Record Not Found on some pages

7 posts by 5 authors in: Forums > CMS Builder
Last Post: March 3, 2009   (RSS)

By Izadorra - March 1, 2009

My client wanted me to post an area at the bottom of each page that contains her copyright in a way that she can edit it each year. I put the code for a single page copyright record at the bottom of each of her pages. The first page of each shows the copyright but subsequent pages say "No Record Found" but it's only 1 record.

http://nancycarleton.com/praiseList.php?page=1 Copyright shows up fine

http://nancycarleton.com/praiseList.php?page=2
and after "No Record Found"

<?php

require_once "/hermes/web01/b2486/pow.nancycarleton/htdocs/cmsAdmin/lib/viewer_functions.php";

list($copyrightRecords, $copyrightMetaData) = getRecords(array(
'tableName' => 'copyright',
'where' => whereRecordNumberInUrl(1),
'loadUploads' => '0',
'limit' => '1',
'allowSearch' => 'false',
));
$copyrightRecord = @$copyrightRecords[0]; // get first record

?>

<?php echo $copyrightRecord['content'] ?><br/>

<?php if (!$copyrightRecord): ?>
No record found!<br/><br/>
<?php endif ?>

Re: [Izadorra] Record Not Found on some pages

By Kenny - March 2, 2009 - edited: March 2, 2009

Try removing 'allowSearch' => 'false', or setting it to true

Let me know if that works.


Kenny

Re: [Izadorra] Record Not Found on some pages

By rebjr - March 2, 2009

I'm not sure what all your client wants to edit, but if it's just the year then why not just have it update automatically using PHP with something like this:

<p>Copyright &copy; <?php echo(date("Y")); ?> Nancy Carleton. All rights reserved.</p>

Re: [Izadorra] Record Not Found on some pages

By Dave - March 2, 2009

I'll give this one a try as well. :)

My guess is it's loading the wrong record number from the url. Try this instead (I removed the where):

list($copyrightRecords, $copyrightMetaData) = getRecords(array(
'tableName' => 'copyright',
'loadUploads' => '0',
'limit' => '1',
'allowSearch' => 'false',
));
$copyrightRecord = @$copyrightRecords[0]; // get first record


That will load the first record from copyright and ignore the record number in the url and ignore any search terms. Let me know if that works for you.
Dave Edis - Senior Developer
interactivetools.com

Re: [rebjr] Record Not Found on some pages

By Izadorra - March 3, 2009

Geez, this would have been much easier. The client requested the ability to edit this herself but using this eliminates the need to. [crazy]

Re: [Dave] Record Not Found on some pages

By Izadorra - March 3, 2009

This worked perfectly. Thank you! [:)]