I’ve been using LIKE for ages which is a useful way to search for part of a word or phrase in a db field.
$conditions = array( 'TABLE.field LIKE'=>'%'.$search_term.'%');
Now i didn’t realise that this wasn’t case sensitive meaning that ‘Ultra’ returned results but ‘ultra’ didn’t.
So to make it case insensitive you can do the following:
$conditions = array('UPPER(TABLE.field) LIKE'=>'%'.strtoupper($search_term).'%');
Not much different but now a useful(UPPER) addition to the sql arsenal.
Filed under: development , cakephp, mysql, postgres, sql
A super easy way to bake cakephp from anywhere in commandline is to add / append your path in .profile/ .bash_login etc.
Add /cake/cake_1.2.3.8166/cake/console or equiv location of your console directory.
ala:
export PATH=/cake/cake_1.2.2.8120/cake/console:/usr/local/bin:/opt/local/bin:/opt/local/apache2/bin:/opt/local/lib/postgresql82/bin:$PATH
Then run source .bash_login etc to enable it or log out and in again.
Filed under: Uncategorized , cakephp, development, resources
from gwoo at cakephp.org
I am happy to announce another release of CakePHP 1.2. CakePHP 1.2.3.8166[1] includes several bug fixes and most importantly a security fix. To understand the security issue please have a look at Ticket #6336[2]. While this may not affect every installation of Cake, we do recommend that everyone take the time to upgrade their applications. Also, note that there was a bug in Paginator related to changing directions on sorting that is now fixed. For a complete list of changes, please look at the changelog[3].
The release is available from the following link
[1] http://bakery.cakephp.org/articles/view/release-cakephp-1-2-3-8166
[2] https://trac.cakephp.org/ticket/6336
Once again, thanks to all the team at cakephp.org for an amazing product. Happy baking
Filed under: Uncategorized , cakephp, release