Home > CakePHP | Lang | PHP > [CakePHP]CakePHP1.2のfind時にDBカラムを型変換して検索条件にする方法。

[CakePHP]CakePHP1.2のfind時にDBカラムを型変換して検索条件にする方法。

$cond["to_char(Hoge.date, 'YYYYMMDD') LIKE '%20081222%' and \"Hoge\".\"id\""] = $hoge["Hoge"]["id"];

こんな感じで。
私、PostgreSQLしか使わんのでMySQLはよく分からんけど、
どっちもDB関数使いたければ検索条件のカラム名の前に突っ込んだらイイんじゃないかと。

Comments:0

add to hatena hatena.comment (0) add to del.icio.us (0) add to livedoor.clip (0) add to Yahoo!Bookmark (0) Total: 0

Comment Form
Remember personal info

Trackbacks:0

Trackback URL for this entry
http://ore.saizensen.net/archives/197/trackback
Listed below are links to weblogs that reference
[CakePHP]CakePHP1.2のfind時にDBカラムを型変換して検索条件にする方法。 from おれ最前線ねっと

Home > CakePHP | Lang | PHP > [CakePHP]CakePHP1.2のfind時にDBカラムを型変換して検索条件にする方法。

Search
Feeds
Meta

Return to page top