where clause when loading records
2 posts by 2 authors in: Forums > CMS Builder
Last Post: January 8, 2013 (RSS)
By jeffsaitz - January 8, 2013
Hi,
How can i only load records that have a date that is after the current date (today's date).
// load records from 'code_updates'
list($code_updatesRecords, $code_updatesMetaData) = getRecords(array(
'tableName' => 'code_updates',
'where' => date > 'current date,
));
By gregThomas - January 8, 2013 - edited: January 8, 2013
Hi Jeff,
I see you found the answer on this post:
http://www.interactivetools.com/forum/forum-posts.php?postNum=2228998
I recently learnt a simpler way to get records by the latest date:
// load records from 'blog'
list($blogRecords, $blogMetaData) = getRecords(array(
'tableName' => 'blog',
'where' => 'date >= DATE(NOW())',
'loadUploads' => true,
'allowSearch' => false,
));
Thanks!
Greg
PHP Programmer - interactivetools.com