将数据库查询到关联数组 codeigniter
我想通过在数据库中获取现有查询来进行数据转换
$konv = $this->db->get('konversi')->result_array();
foreach ($konv as $result) {
$konv_data[$result['kata']] = $result['konversi'] . ",";
}
$descc = strtr($data['description'], $konv_data);
I want to make a data conversion, by fetching an existing query in the database
$konv = $this->db->get('konversi')->result_array();
foreach ($konv as $result) {
$konv_data[$result['kata']] = $result['konversi'] . ",";
}
$descc = strtr($data['description'], $konv_data);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

将其更改
为
您将使用 te result() 方法将结果作为关联数组获取。
change this
to
You are getting result as associative array by using te result() method.