1

私は本当にphp.activerecordが初めてです。私の無知でとてもむき出しです。クエリでワイルドカードを使用する手段はありますか? 例: "Some%" で、something、someone、something、somewhere... を返します。

http://www.phpactiverecord.org

4

1 に答える 1

1

phpactiverecordのドキュメントから直接取得

# 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 に答える