In table tb_usulan,I have a field like this:
id_usulan | name | merk | katalog
-------------------------------------------------
1 | Pipet 1 ml | Pyrex | 1234123
2 | Pipet 1 ml | Example2| 1322134
3 | Alkohol 70% | Brataco | 5938291
4 | Aquadest | Amidis | 9586830
5 | Alkohol 70% | Example | 2312314
I want to grouping data per name in my page, like this:
If i use this code:
$queryalat1="select * from tb_usulan Order by name ";
$hasil = mysql_query($queryalat1);
$no = 1;
while ($data=mysql_fetch_array($hasil)){
$id= $data['id_usulan'];
echo" <tr style='color:#000000;'>
<td align='center'><input type='checkbox' name='cek[]' value='$data[id_usulan]' ></td>
<td align='center'>$no.</td>
<td style='text-align:left; padding-left:5px;'>$data[name]</td>
<td style='text-align:left; padding-left:5px;'>$data[merk]</td>
<td style='text-align:left; padding-left:5px;'>$data[katalog]</td>
<td align='center'><a href ='edit2.php?id=$id'>Edit</a> | <a href ='del2.php?id=$id'>Hapus</a></td>
</tr>";
$no++; }
It will be show the table like this:
So if there's anyone who can help me with this problem, I really appreciate it.
Thanks.