Free Android CakePHP GMaps Articles by Bali Web Design

July 7, 2009

SQL BETWEEN Syntax in Cakephp

Filed under: php — Tags: — admin @ 1:50 am

This article is telling you a code to implement BETWEEN Sql sintak for sql conditions when using cakephp framework. For example we have a table name ‘posts’ and field ‘id’, and then we want to query like this

SELECT * FROM posts WHERE id BETWEEN 1 AND 10

The syntax for above query can be constructed using this cakephp syntax

$this->Post->find(’all’, array(’conditions’=>array(’Post.id BETWEEN ? AND ?’ => array(1, 10))));

I think this syntax is the easiest one to create SQL BETWEEN sintak using cakephp


No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment