LIKE and % Wildcard in Doctrine's findBy*()

前端 未结 1 411
长发绾君心
长发绾君心 2021-02-12 17:31

How do I write the following MySQL query using Doctrine\'s findBy*() method?:

SELECT column_name1, column_name2 FROM table_name
WHERE column_name3 LIKE \'%search         


        
1条回答
  •  星月不相逢
    2021-02-12 18:02

    $users = Doctrine::getTable('User')->createQuery('u')
      ->where('column_name3 LIKE ?', '%search_key%')
      ->execute();
    

    0 讨论(0)
提交回复
热议问题