FIXING VIEWER SHOWING ONLY THE FIRST RECORD - Aug 2nd, 2010


If you’re only seeing information on the first record and not on subsequent records, or you’re getting “Undefined
index” errors about fields you know exist, you’re not alone.

According to Dave Edis, of Interactive Tools the fix may be really simple. He says:

What may be happening is that the line:


'where' => whereRecordNumberInUrl(1),


in the “required” code at the top of the page is trying to load the record number that is on the end of the url:


list($your_tableRecords, $your_tableMetaData) = getRecords(array(
'Table name' => 'your_table',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));


So when the URL ends in 1 (or nothing) that works fine, but when it's another record number, it won't work. Try removing
that ‘where’ line:

Dave added: You can also, add:



allowSearch => false,


so later when you add searching capability it won't "pre-filter" those records, since he’s assuming you’ll want to
show them all the time:


list($your_tableRecords, $your_tableMetaData) = getRecords(array(
'Table name' => 'your_table',
'limit' => '1',
'allowSearch' => false,
));



The materials on this web site have been created for use with CMS Builder content management software. CMS Builder software is published and licensed for use by InteractiveTools.com. Please contact Interactive Tools for information on the downloading of the software or the purchasing of licenses.


Terms of Service