• Menu tree Unlimited Category Sub Category

    If you want to make a menu tree (unlimited category sub category) using PHP and MySQL, this script will help you.

    Step: 1
    Create database table menu.

    View Code MYSQL
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    
    CREATE TABLE IF NOT EXISTS `menu` (
     
      'menu_id' int(11) NOT NULL AUTO_INCREMENT,
     
      'menu_parent_id' int(11) NOT NULL,
     
      'menu_title' varchar(100) NOT NULL,
     
      PRIMARY KEY ('menu_id')
     
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;
     
    INSERT INTO 'menu' ('menu_id', 'menu_parent_id', 'menu_title') VALUES (1, 0, 'A'),(2, 0, 'B'),(3, 1, 'A.1'),(4, 1, 'A.2'),(5, 2, 'B.1'),(6, 2, 'B.2'),(7, 3, 'A.1.1'),(8, 3, 'A.1.2'),(9, 7, 'A.1.1.1'),(10, 7, 'A.1.1.2');

    Step: 2

    1
    
     

Comments on this post

Leave a Reply

  • Security Code :


    8 × = sixty four