• 12-10-2012, 15:41:56
    #1
    Arkadaşlar yapmak istediğim sey şu 1 tane veritabanım var icinde ise haberler ve resimler adlı "2 tane "

    ayrı "tablo" var
    "haber" tablosunda icindeki sutunlar şunlar
    id
    ozet
    baslik

    "resimler" tablosunda ise
    resimid
    resim

    ben aşağıdaki manset bölümüne entegre etmek istiorum nasıl yapabilirim resme tıkladığımda
    resim ve haber özetleri gelecek aşağıda kod mevcuttur bir yardımcı olurmusunuz.


    <div class="eleven columns row alpha omega">
    <div id="featured-slider" class="block">
    <div id="slider" class="nivoSlider">
    <!-- max five (5) images -->
    <img src="images/featured-image-1.jpg" data-thumb="images/featured-image-1.jpg" alt="" title="#htmlcaption-1" />
    <img src="images/featured-image-2.jpg" data-thumb="images/featured-image-2.jpg" alt="" title="#htmlcaption-2" />
    <img src="images/featured-image-3.jpg" data-thumb="images/featured-image-3.jpg" alt="" title="#htmlcaption-3" />
    <img src="images/featured-image-4.jpg" data-thumb="images/featured-image-4.jpg" alt="" title="#htmlcaption-4" />
    <img src="images/featured-image-5.jpg" data-thumb="images/featured-image-5.jpg" alt="" title="#htmlcaption-5" />
    </div>
    <div id="htmlcaption-1" class="nivo-html-caption">
    <h4>haberş</h4>
    <p>haber icerik.</p>
    </div>
    <div id="htmlcaption-2" class="nivo-html-caption">
    <h4>haberş</h4>
    <p>haber icerik.</p>
    </div>
    <div id="htmlcaption-3" class="nivo-html-caption">
    <h4>haberş</h4>
    <p>haber icerik.</p>
    </div>
    <div id="htmlcaption-4" class="nivo-html-caption">
    <h4>haberş</h4>
    <p>haber icerik.</p>
    </div>
    <div id="htmlcaption-5" class="nivo-html-caption">
    <h4>haberş</h4>
    <p>haber icerik.</p>
    </div>
    </div>
    </div>
  • 12-10-2012, 17:27:37
    #2
    Merhaba Öncelikle veritabanında az bi değişiklik yapmalısın

    tablo: resimler
    id : otomatik sayı ( yenileme yok + birincil anahtarı)
    resimbuyuk:
    resimkucuk:

    tablo: haber
    id : otomatik sayı ( yenileme yok + birincil anahtarı)
    resim_id:
    baslik:
    özet:

    veritabanına kayıt yaparken resimler toblosundaki id ile ilgili haberin tablodaki resim_id aynı olmalıdır.

    ve gerekli kod
    <%
    Set baglanti = Server.CreateObject("ADODB.Connection")
    baglanti.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("admin/data/ntrn_tklf.mdb")
    %>
    
    
    
    <div class="eleven columns row alpha omega">
    <div id="featured-slider" class="block">
    <div id="slider" class="nivoSlider">
    
    <% 
    set resim = server.createobject("adodb.recordset")
    rSQL = "SELECT TOP 5 * From resimler ORDER BY ID desc"
    resim.open rSQL, baglanti, 1, 3
    %>
    
    <%Do While Not resim.Eof%>
    	<img src="<%=resim("resimbuyuk")%>" data-thumb="<%=resim("resimkucuk")%>" alt="" title="#htmlcaption-<%=resim("id")%>"/>
    <%
    resim.MoveNext : Loop
    %>
    </div>
    <% 
    set haber = server.createobject("adodb.recordset")
    hSQL = "SELECT TOP 5 * From haber ORDER BY resim_id desc"
    haber.open hSQL, baglanti, 1, 3
    %>
    
    <%Do While Not haber.Eof%>
    <div id="htmlcaption-<%=haber("resim_id")%>" class="nivo-html-caption">
    <h4><%=haber("baslik")%></h4>
    <p><%=haber("özet")%></p>
    </div>
    <%
    haber.MoveNext : Loop
    %>
    <%  
      resim.Close  
      Set resim = Nothing
      haber.Close  
      Set haber = Nothing     
    %> 
    </div>
    </div>
    Deneme imkanım olmadı denersin hata olacağını sanmıyorum ama olursa yazarsın