devilinc Posted December 16, 2010 Share Posted December 16, 2010 I need someone to translate this into CakePHP style....dont want to use normal queries..... SELECT * FROM `departments` WHERE `department_name` LIKE '%hi%' OR `department_email LIKE '%hi%' here i use the email or name from a text field input so i will handle it but if u could just translate this it into cakephp thanks a lot!!! Quote Link to comment https://forums.phpfreaks.com/topic/221841-need-a-corresponding-cake-php-query-using-find-for-my-sql-query/ Share on other sites More sharing options...
devilinc Posted December 16, 2010 Author Share Posted December 16, 2010 this is how far i have reached...could anyone advise me if i have written something wrong? $conditions = array( "OR" => array ( "department_name LIKE" => "%".$this->data['Department']['department_search']."%", "department_email LIKE" => "%".$this->data['Department']['department_search']."%" ) ); $search_results = $this->Department->find('all', array('conditions' => $conditions)); Quote Link to comment https://forums.phpfreaks.com/topic/221841-need-a-corresponding-cake-php-query-using-find-for-my-sql-query/#findComment-1147997 Share on other sites More sharing options...
devilinc Posted December 16, 2010 Author Share Posted December 16, 2010 I think the above query does the simple search...thanks for looking though!!! Quote Link to comment https://forums.phpfreaks.com/topic/221841-need-a-corresponding-cake-php-query-using-find-for-my-sql-query/#findComment-1148019 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.