This is how you’d write a BETWEEN… AND… SQL query in a cake-like way. The example should be pretty much self explanatory: $this->Post->find(‘all’, array(‘conditions’=>array(‘Post.id BETWEEN
Month: June 2008
An interesting point came up on IRC… What happens if someone submits data to your application via a fake form? How can you ensure that
As you know, for a good reason, CakePHP will use the POST method by default to submit form data. However, there is a case where
What exactly is the differednce between $this->User->read() and $this->User->find()? Seemingly, they both retrieve the data (and possibly associated data) for the User model. Yet, there
There are a few important changes in the database configuration, which I wanted to quickly point out: 1. ‘connect’ key is gone. For example, if
In a few simple words: use the ‘comparison’ rule to validate a checkbox. To give you an example, let’s say a user needs to agree
Note, this article was written a long time ago for CakePHP version 1.x … many of the points described here still apply in the latest
I’m not sure that you should really be doing this, but I recall running into one situation where I wanted to set some variable in
Just recently ( end of May, 2008 ) there was an addition to CakePHP’s find method to easily build a GROUP BY in your SQL.