I am mikek's Blog

The personal blog of Mike Karthauser, who you may know from Brightstorm Limited or the internet.

A better like for searching

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, , , ,

Bake path for cakephp

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, , ,

Useful cakephp resources

A couple of useful cakephp resources have turned up on the twittersphere which will super handy for those wanting to learn or increase their knowledge of cakephp.

Matt psuedo coder ssuper awesome cakephp tips

Chris Harjtes Refactoring Legacy Applications Using CakePHP

I’ve also been tagging cakephp related stuff on my delicious account – which you can find at http://delicious.com/brightstorm/cakephp.

Filed under: Uncategorized, ,

New cakephp release 1.2.3.8166

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, ,

what's hot

Flickr Photos

Tree graffiti

Tree graffiti

Tree graffiti

More Photos

Sponsor Mike run the Bath Half marathon

mikek on twitter