Onlt getting first record

5 posts by 3 authors in: Forums > CMS Builder
Last Post: September 30, 2011   (RSS)

Re: [Toledoh] Onlt getting first record

By Jason - September 30, 2011

Hi Tim,

The problem here is with your first query. Since you are not setting a WHERE clause, getRecords() is just returning the first record from the database. Try this change:

list($listingsRecords, $listingsMetaData) = getRecords(array(
'tableName' => 'listings',
'where' => whereRecordNumInUrl(),
'limit' => '1',
));
$listingsRecord = @$listingsRecords[0];
if (!$listingsRecord) { header("HTTP/1.0 404 Not Found"); print "Listing not found!"; exit; }


Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Onlt getting first record

Thanks Jason,

'where' => whereRecordNumberInUrl(),

gave an error, but

'where' => whereRecordNumberInUrl(1),

worked fine
Cheers,

Tim (toledoh.com.au)

Re: [Toledoh] Onlt getting first record

By ross - September 30, 2011

Hi Tim

Great! Wanted to make sure that means you are back in business. Let me know if there is something I can still go over with you on this one.

Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [ross] Onlt getting first record

All good - thanks Ross
Cheers,

Tim (toledoh.com.au)