Skip to content
  • Archives
  • Buy Adspace
  • Contact me
  • Hide Ads for Premium Members

zen of coding

holistic web development

  • Archives
  • Buy Adspace
  • Contact me
  • Hide Ads for Premium Members
  • Home
  • 2008
  • June
  • 30
  • BETWEEN AND SQL syntax in CakePHP
CakePHP

BETWEEN AND SQL syntax in CakePHP

June 30, 2008 vladko

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 ? AND ?’ => array(1, 10))));

Note, that CakePHP will quote the numeric values depending on the field type in your DB.

  • Share on Facebook (Opens in new window) Facebook
  • Share on X (Opens in new window) X
  • Share on Reddit (Opens in new window) Reddit
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Email a link to a friend (Opens in new window) Email

Like this:

Like Loading…

Related

Related Posts

php mvc frameworks and microservices
CakePHP Design Docker Frameworks Laravel Lumen Microservices MVC Symfony Zend

PHP MVC Frameworks preview of 2018 (Phalcon 3, Symfony 4, Laravel 5.x and others)

December 31, 2017December 5, 2020 vladko
CakePHP Devops Docker Microservices MVC Open source

The State of PHP MVC Frameworks in 2017 (Laravel, Symfony, CodeIgniter, CakePHP, Zend)

February 27, 2017January 11, 2018 vladko

Post navigation

Previous: CakePHP and save() security
Next: What can we learn from CakePHP tests?

New Posts

  • I don’t bother with “whiteboard interviews”.
  • PHP MVC Frameworks preview of 2018 (Phalcon 3, Symfony 4, Laravel 5.x and others)
  • Case study: building a better search with Algolia and Lumen PHP
  • The State of PHP MVC Frameworks in 2017 (Laravel, Symfony, CodeIgniter, CakePHP, Zend)
  • The great PHP MVC Framework Showdown of 2016 – (CakePHP 3 vs Symfony 2 vs Laravel 5 vs Zend 2)

Top Posts & Pages

  • Case study: building a better search with Algolia and Lumen PHP
  • Book review: CakePHP Application Development
June 2008
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  
« May   Jul »
All Rights Reserved 2024.
Proudly powered by WordPress | Theme: Fairy by Candid Themes.
%d