我有一个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