Ayrı Tablolarda Depolanan Kategoriler ve alt kategoriler seçin ve göz

0 Cevap php

Ben liste ve ayrı tablolarda kategori düzeylerini saklamak zaman, kategori ve alt kategorileri ve bunların kayıtları (sınıflandırılmış reklamlar) göz atmak için bir çözüm arıyorum. Geçmişte komşuluk modeli ile çalıştım ama şimdi bu veritabanı kurulumu sopa var, ve benim için yeni. Ben php ve mysql kullanıyorum.

Site ortak şekilde yapılandırılmış bir seri ilan sitesi: en, böylece istediğiniz kategori bağlantılardan birini sonra sadece alt kategoriler listelenir ve bu kategoriye ait reklamları tıkladığınızda, kendi ana sayfasında ana kategori listesi vardır, ve her düzeyde.

Ben şu alanlarında biraz kafam karıştı:

  1. How do you construct the category links when browsing categories in order for the script to know which table it should select categories from if I consider the below mysql structure? Do I need separate parameters at every category level I access like e.g: "mysite.com/?cat2=4" when accessing category "4" in the cat2 table and "mysite.com/?cat3=9" when accessing category "9" in cat3 table in order to identify category levels? If separate parameter not needed, then how can php and mysql tell what table you have to select the categories from?

  2. And most importantly in this case, what is the best way to construct SEO friendly links? And how will mysql know which table to select categories from? I would like to use the most simplest solution that is possible like: mysite.com/electronics/television/sony. As far as I know, I have to include at least the cat_id somewhere in the link... where do I put it? and do I have to include the number of level as well? To complicate it more the category names are in foreign language with accented characters (though I created a function that changes accented characters into latin ones on the fly when generating category links) so I think it is best to select them by their ids.

  3. How is a sample mysql select looks like that selects the child categories of a certain category?

  4. How can I construct breadcrumb navigation?

MYSQL STRUCTURE:

  • Tablo "cat1" (ana kategori):

    cat1_id | cat1_name

  • Tablo "cat2" (alt grup):

    cat2_id | cat1_id | cat2_name

  • Tablo "cat3" (subsubcategory):

    cat3_id | cat2_id | cat3_name

  • Table "reklamlar":

    ad_id | cat1_id | cat2_id | cat3_id | ad_title | ad_description

Thanks and sorry for the long post.

0 Cevap