title: MySQL operating hierarchical data
body: <p>I have MySQL table structure:</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `categories` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `parent_id` int(10) unsigned NOT NULL DEFAULT '0',
    `name` varchar(255) NOT NULL DEFAULT '',
    `is_working` tinyint(1) unsigned NOT NULL DEFAULT '1',
  );
  </code></pre>
  
  <p>which helds hierarchical data with relations of <code>id</code> and <code>parent_id</code></p>
  
  <p>I have 5 levels depth tree, like:</p>
  
  <pre><code>CATEGORY LEVEL 1
    SUBCAT LEVEL 2
      SUBCAT LEVEL 3
        SUBCAT LEVEL 4
          SUBCAT LEVEL 5
  </code></pre>
  
  <p>I need (the question): if I'm setting <code>is_working</code> = 0 for some category or subcategory, <code>is_working</code> is being set to <code>0</code> for all of it's subcategories.</p>