I'm trying to make a list, showing all of my Categories on my Forum. Showing the Category name, with an ID, aswell as a count, counting how many Threads is attached to this Category.
It works perfectly, however, it prints the results twice.
This is the SQL
SELECT categories.category_name, threads.thread_category_id, COUNT(*)
AS 'threadCount' FROM threads
INNER JOIN categories ON categories.category_id = threads.thread_category_id
GROUP BY categories.category_name, threads.thread_category_id
Here is the result
And as you can see, it prints the same thing twice, which it should't.
EDIT: Here is the ASP.
<asp:Repeater ID="categories" runat="server">
<HeaderTemplate>
<table id="kategorier" cellspacing="0">
<tr>
<td class="head">Name</td>
<td class="head" style="width:70px">Number of Threads</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td class="item"><a href="Kategori.aspx?id=<%# Eval("thread_category_id") %>"><%# Eval("category_name") %> - ID: <%# Eval("thread_category_id")%></a></td>
<td class="item" style="text-align:right"><%# Eval("threadCount") %></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>