Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    May 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Receiving data from categories

    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?

    Code:
      <% 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 %>

  • #2
    New to the CF scene
    Join Date
    May 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Problem solved. Thanks.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •