我想从数据库中获取数据使用PHP
这个Sql请求你会看到我有3个表,但在表Milestoneevent
我有不同的值列libelle
所以我想显示像这样加入表格显示没有重复
标识NUM libelle1 libelle2 libelle3 ..... SQL reql要求和PHP
select DISTINCT file.num,file.id as filenumber,file.numlta,milestones.id,milestones.libelle,milestoneevent.idmilestone,milestoneevent.dat,milestoneevent.idfile from file,milestones,milestoneevent where milestoneevent.idfile=FILE.num and milestoneevent.idmilestone=milestones.id
while (row=mysqlfetchassoc(
rs_result)) {
//print_r($row); // debug code ?>
<tr>
<td><input type='checkbox' name="approve[]" id="check" value=<?php echo $row['num']?>></td>
<td><?php echo $row['filenumber']; ?></td>
<td><?php echo $row['numlta']; ?></td>
<td><?php echo $row['designation']; ?></td>
<td><?php echo $row['libelle']; ?></td>
<td><?php echo $row['milestonedate']; ?></td>
</tr>
在图片中你看到了一排cqn
在不同的日期
编辑
为libelle
列多个值作为意见中的要求,这是我期望的输出:
我不得不在这里添加图片评论中讨论导致不能添加它
'BY libelle'(或领域,你想成为唯一的)GROUP也许 ? – Gogol
我不知道你在做什么。你能否提供你的样本数据的预期输出? – Shadow
预期数据显示 49 A2006/0324 --- 1 --Exemption ..- 1 --- 2016-03-03-49 50 A2006/0327 --- 1 --Exemption ..- 1 --- 2016-03-03-49 51 A2006/0325 --- 1 --Exemption ..- 1 --- 2016-03-03-49 7 A2006/0325 --- 1 - 豁免CA ..- 1 --- 2016-03-03-49 多数民众赞成 只需添加其他libelle像客户端retourned豁免函 – user2128925