PHP Classes

File: sample.sql

Recommend this page to a friend!
  Classes of Alex B. Snet   SQL Tree   sample.sql   Download  
File: sample.sql
Role: Example script
Content type: text/plain
Description: SQL Sample
Class: SQL Tree
Manage tree elements stored in a MySQL database
Author: By
Last change:
Date: 15 years ago
Size: 1,156 bytes
 

Contents

Class file image Download
CREATE TABLE IF NOT EXISTS `pages` (
  `id` int(10) NOT NULL auto_increment,
  `pid` int(10) NOT NULL,
  `left` int(10) NOT NULL,
  `right` int(10) NOT NULL,
  `lvl` int(10) NOT NULL,
  `name` varchar(255) character set latin1 NOT NULL,
  `content` text character set latin1 NOT NULL,
  PRIMARY KEY (`id`),
  KEY `pos` (`left`,`right`,`lvl`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Alex''s prototype tree structure =)' AUTO_INCREMENT=17 ;


INSERT INTO `pages` (`id`, `pid`, `left`, `right`, `lvl`, `name`, `content`) VALUES
(1, 0, 1, 32, 1, 'root', 'CodeTeam =)'),
(2, 1, 2, 9, 2, 'Directors', ''),
(3, 1, 10, 23, 2, 'Managers', ''),
(4, 1, 24, 31, 2, 'Art-directors', ''),
(5, 2, 3, 8, 3, 'Clients', ''),
(6, 3, 11, 12, 3, 'Office', ''),
(7, 3, 13, 20, 3, 'Developers', ''),
(8, 3, 21, 22, 3, 'Money', ''),
(9, 4, 25, 30, 3, 'Designers', ''),
(10, 5, 4, 5, 4, 'Client 1', ''),
(11, 5, 6, 7, 4, 'Client 2', ''),
(12, 7, 14, 15, 4, 'PHP-Developer', ''),
(13, 7, 16, 17, 4, 'JS-Developer', ''),
(14, 7, 18, 19, 4, 'CSS-Developer', ''),
(15, 9, 26, 27, 4, 'UI-Designer', ''),
(16, 9, 28, 29, 4, 'Image disigner', '');