...

View Full Version : Receiving data from categories



efet
05-25-2007, 02:41 PM
I am working on admin area of my news section. I can add/delete categories to it. On my admin/news/view page I want to list my news under their categories. I coded something but its not working. Why do you think so?


<% sub view %>

<%
Set objK = Server.CreateObject("ADODB.RecordSet")
objK.Open "SELECT * FROM KATEGORILER", objConn, 1, 3

K_ID=objK("K_ID")
Set objViewH = Server.CreateObject("ADODB.RecordSet")
objViewH.Open "SELECT * FROM HABERLER WHERE K_ID="&K_ID&" ORDER BY TARIH DESC", objConn, 1, 3

%>
<table width="600" border="1">
<tr>
<td colspan="5">
Haber Goruntuleme</td>
</tr>
<tr>
<td colspan="5">
<a href="haber.asp?Process=add">add</a> |
<a href="haber.asp?Process=view">view</a>(edit&delete)
</td>
</tr>
<tr>
<td>
</td>
<td>
BASLIK</td>
<td>
AKTIF
</td>
<td>
MANSET
</td>
<td>
TARIH
</td>
</tr>
<%
i = 0
Do While not objK.EOF
%>
<tr>
<td width="100">&nbsp;
</td>
<td colspan="4">
<%=objK("KATEGORI")%><%=objK("K_ID")%>
</td>
</tr>
<%
while not objViewH.EOF
%>
<tr>
<td width="100">
<a href="haber.asp?Process=edit&ID=<%=objViewH("ID")%>">
Düzenle</a>&nbsp;
<a href="haber.asp?Process=delete&ID=<%=objViewH("ID")%>">
Sil</a>
</td>
<td width="200">
<%=objViewH("BASLIK")%><%=objViewH("K_ID")%>
</td>
<%
If objViewH("MANSET") = true Then
m_check = "checked"
ElseIf objViewH("MANSET") = false Then
m_check = ""
End If
%>
<td>
<input type="checkbox" disabled="true" name="MANSET" <%=m_check%>>
</td>
<%
If objViewH("DURUM") = true Then
d_check = "checked"
ElseIf objViewH("DURUM") = false Then
d_check = ""
End If
%>
<td>
<input type="checkbox" disabled="true" name="DURUM" <%=d_check%>>
</td>
<td>
<%=objViewH("TARIH")%>
</td>
</tr>
<%if not objViewH.Eof Then
objViewH.movenext
end if
wend %>
<%
i = i + 1
objK.movenext
loop
%>
<% end sub %>

efet
05-25-2007, 09:02 PM
Problem solved. Thanks.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum