0
我不知道發生了什麼與此更新呼叫丟失,這是我的代碼:Zend的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)
爲什麼不'值'被填充?
好的,這似乎是正確的:[1] => 999.爲什麼它沒有進入聲明? – rladd 2012-07-10 19:25:40
當然,你不能更新一個空行,你可以嗎?謝謝你的幫助Tim! – rladd 2012-07-10 19:57:37