2012-02-25 88 views
1

我已經與FIND_IN_SET()的SQL查詢工作與Zend框架 一直困擾我有這樣Zend Framework中的FIND_IN_SET()?

$profileIds = "1,2,3"; 
$matchjobQry = $this->_db->select()->from('user_resume_skill') 
            ->where('rsl_status=1') 
            ->FIND_IN_SET('rsl_prf_id ',"$profileIds"); 
$matchjobRes = $this->_db->fetchAll($matchjobQry); 

平我正確的查詢,,代碼 由於事先

回答

4

最後我來知道實現這個查詢的確切方式,,傢伙們用它

$profileIds = "1,2,3"; 
$matchjobQry = $this->_db->select()->from('user_resume_skill') 
            ->where('rsl_status=1') 
//this is the exact way of approaching zend, and finally got the answer 
            ->where('FIND_IN_SET(rsl_prf_id,(?))', "$profileIds"); 
$matchjobRes = $this->_db->fetchAll($matchjobQry);