我有一個Choice
列表包含4種類型的文章。用戶應該選擇一個。現在列表變成包含45篇文章,我將choice list
更改爲checkBox list
以供多種選擇。檢索數據複選框-php
這因循setter
功能:
public function setNature($nature) {
$this->_nature = $nature;
if ($nature === 'Production') { $this->_nature='Production'; }
elseif ($nature === 'A'){ $this->_nature='A';}
elseif ($nature === 'B') {$this->_nature='B';}
else $this->_nature ='all';
}
如何我可以改變這個二傳手功能recovre不寫所有的45種物品中的數據?
謝謝你的有用的答案。有效的是,45條款存儲在我的數據庫中的表格中。 – Nazly
如果您檢索它們,您可以將它們設置爲一個數組,這樣您就不必再次更新它,只需使用以逗號分隔的自然列表即可,此代碼將起作用。 – FMashiro