2012-07-10 2 views
0

내가이 업데이트 호출 실종 모르겠어요 설정되지 않고, 여기에 내 코드입니다 :젠드 DB 갱신 값이

$table = new Application_Model_DbTable_ProductContaminant(); 
$db = $table->getAdapter(); 

$db->getProfiler()->setEnabled(true); 
$data = array('value' => '999'); 
$where[] = $db->quoteInto('product_id = ?', $q['product_id']); 
$where[] = $db->quoteInto('contaminant_id = ?', $k); 
$table->update($data, $where); 

print $db->getProfiler()->getLastQueryProfile()->getQuery(); 

그리고 프로파일 러의 출력은 다음과 같습니다

UPDATE `product_contaminants` SET `value` = ? WHERE (product_id = '4802') AND (contaminant_id = 69) 

왜 아니다 '가치'는 채워지 는가 ??

답변

2

getQuery는 매개 변수 자리 표시자가있는 준비된 명령문 만 반환하기 때문에 값이 채워지지 않습니다. 업데이트 할 때 사용되는 매개 변수를 사용하려면 다음을 시도하십시오.

$db->getProfiler()->getLastQueryProfile()->getQueryParams() 

자세한 정보 here

+0

좋아요, 올바른 것 같습니다 : [1] => 999. 왜 진술에 들어 가지 않습니까? – rladd

+0

물론 빈 행을 업데이트 할 수 없습니다. 도와 줘서 고마워 Tim !! – rladd