MySQL tablo sorunu silmek

0 Cevap php

Ben pek çok kategori var çünkü, ben bir tek "kategoriler" veritabanı tablo oluşturulur:

"id_category , parent_id , category_name , category_tag"

Örnek:

  ----------------------------------------------------------
  | id_category | parent_id | category_name | category_tag |
  ----------------------------------------------------------
  | 1           | 0         | Cars          | cars         |
  | 2           | 1         | Parts         | parts        |
  | 3           | 2         | Accesories    | accesories   |
  ----------------------------------------------------------

ağaç:

  Cars
     |_Parts
           |_Accesories

My problem occurs when I want to delete all records in the tree. How do I delete all records in the tree branch from above example.

Bu PHP ile mySQL mümkün mü?

0 Cevap