I'm really new to php.activerecord. So bare with my ignorance. Is there a means of doing a wildcard in a query with it? ie: "Some%" and it returns something, someone, somewhat, somewhere...
1条回答 默认 最新
- douhui2307 2011-09-15 02:19关注
Taken straight from the phpactiverecord documentation
# fetch all the cheap books! Book::all(array('conditions' => 'price < 15.00')); # sql => SELECT * FROM `books` WHERE price < 15.00 # fetch all books that have "war" somewhere in the title Book::find('all', array('conditions' => "title LIKE '%war%'")); # sql => SELECT * FROM `books` WHERE title LIKE '%war%'
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报