我对 php.activerecord 真的很陌生。对我的无知如此赤裸裸。有没有办法在查询中使用通配符?即:“Some%” 它返回某物,某人,某处,某处......
问问题
343 次
1 回答
1
# 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%'
于 2011-09-15T02:19:12.817 回答