ak493305445 发表于 2012-12-6 13:20:13

取数据库的字段

我读取数据库的一个字段,怎么让他只显示不同的,相同的只显示一个。

ak493305445 发表于 2012-12-6 13:34:21

<?php echo lang($right_group ); ?>

ak493305445 发表于 2012-12-6 13:50:41

distinct 这个在什么地方加?

ak493305445 发表于 2012-12-6 14:48:43

<?php echo $this->form->distanct($v_right_group);?> 我这样显示distinct为定义,我该在什么地方定义?怎么定义?

傲罗 发表于 2012-12-8 11:22:26

在sql语句的地方写
$this->db->query('SELECT distanct id from tablle')->result_array();

qunian25 发表于 2012-12-10 11:40:27

$this->db->distinct();
$this->db->get('table');

ichou 发表于 2012-12-10 19:07:39

如果你用AR就如LS
不用就如LS的LS

文档丰富 可是没人看http://codeigniter.org.cn/user_guide/database/active_record.html

ak493305445 发表于 2012-12-11 17:17:00

$this->db->distinct(); 这个放在什么地方?
页: [1]
查看完整版本: 取数据库的字段