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

前端 未结 1 1938
不知归路
不知归路 2021-02-12 17:46

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 17:59
    $users = Doctrine::getTable('User')->createQuery('u')
      ->where('column_name3 LIKE ?', '%search_key%')
      ->execute();
    
    0 讨论(0)
提交回复
热议问题