Saturday, 17 August 2013

Search similar results

Search similar results

In my database, I will have college building rooms (such as B100, A200,
TLAB100) and I want it so that when people search for a specific room
(such as B101, B102) it will return the building name without the ending
number, so: B100.
My controller so far looks like this:
$results = $this->Building->find('all', array(
'conditions' => array(
'Building.building LIKE' => $this->data['Food']['q']
)
)
);
But I believe LIKE isn't the right command for it. Because it's not
working that way

No comments:

Post a Comment