|
posted 03/7/2008 by Chris
For such an important function, there seem to be very few examples out there...
$search_where = array('category'=>'misc'); $return_these_db_columns = 'id,title,content,publish_date'; $order_by = 'publish_date DESC'; $show_this_page = 2; //this is only static for testing - would be dynamic for pagination $show_this_many_per_page = 15; //number of blog posts to show per page /* * only Blogs with thier "category" column matching "misc" are returned * this will return an array of Blog objects with variables id, title, content, and publish_date * the array will be ordered by publish_date from biggest to smallest * only results 16-30 from the database will be returned */ $blogs = $this->Blog->findAll( $search_where, $return_these_database_columns, $order_by, $show_this_many_per_page, $show_this_page ); COMMENTS (displaying 0 comments) POST (leave a comment) |
POPULAR BLOG TAGS
bakery
defcon
debuggeddesigns
sports
skateboard
orwell
whoami
color
encryption
google
brain
class
cakephp
code
snowboard
geek
launch
boston
general
mbta
mit
trice
youtube
regular expressions
email
published
php5tube
as
hobnox
gmail
privacy
rot13
germans
mailto
usort
spam
flash
charlie
routes
security
1984
science
open source
captcha
drum machines
magazine
quicksilver
php
release
ableton
|