我正在尝试根据表中的config_name检索config_value
,如codeigniter项目中的图像所示。即使我也不知道从哪里开始。我在互联网上找到了类似的东西(示例)。
$this->db->select('age');
$this->db->where('id', '3');
$q = $this->db->get('my_users_table');
$data = $q->result_array();
echo($data[0]['age']);
最佳答案
做这样的事情:
$this->db->where('config_name', 'Account_activation');
$q = $this->db->get('my_users_table');
/* if u r fetching one row use row_array instead of result_array*/
$row = $q->row_array();
echo $row['config_value'];
了解更多:https://www.codeigniter.com/user_guide/database/index.html
关于php - 如何检索 codeigniter 中的列值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51463435/