简体   繁体   English

如何在同一个表中显示具有相同列不同 id 的 2 个值

[英]How to show 2 value with same column different id in same tables

i want to fetch data to tables, i have 3 id_user in 1 row data with different value, i cant figure out what i must do for show 3 fullname of my id_user, everytime i add another full_name always same value who come out, this is my code:我想将数据提取到表中,我在 1 行数据中有 3 个 id_user 具有不同的值,我无法弄清楚我必须为显示我的 id_user 的 3 个全名做什么,每次我添加另一个全名总是相同的值时出来,这是我的代码:

//sample: //样本:

tbl_dokumen (
  id_user int(11) NOT NULL,
  id_qhse int(11) NOT NULL,
  id_kbidang int(11) NOT NULL;

Model Model

public function pengirim()
{
    $this->db->select('a.*,b.full_name,c.nama_departement, d.nama_jenis, e.nama_leveld,f.nama_progres,g.nama_section');
    $this->db->join('tbl_user b', 'a.id_user=b.id_user');
    $this->db->join('tbl_departement c', 'a.id_departement=c.id_departement');
    $this->db->join('tbl_jenis_dokumen d', 'a.id_jenis=d.id_jenis');
    $this->db->join('tbl_level_dokumen e', 'a.id_leveld=e.id_leveld');
    $this->db->join('tbl_progres f', 'a.status=f.id_progres');
    $this->db->join('tbl_section g', 'a.id_section=g.id_section');
    return $this->db->order_by('id_dokumen ASC')
        ->get('tbl_dokumen a')
        ->result();
}

this my view:这是我的观点:

                            <?php
                            $no = 1;
                            foreach ($pengirim as $pe) {
                            ?>
                                <tr>
                                    <td><?php echo $no++ ?></td>
                                    <td><?php echo $pe->kode_dokumen ?></td>
                                    <td><?php echo $pe->nama_dokumen ?></td>
                                    <td><?php echo $pe->full_name ?></td>
                                    <td><?php echo $pe->created_at ?></td>
                                    <td><?php echo $pe->update_at ?></td>
                                    <td><?php echo $pe->nama_progres ?></td>

                                </tr>
                            <?php } ?>

Do you want to show full name of all users in first row?您想在第一行显示所有用户的全名吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM