ÓеÄÏÂÃæÒ»¸ösqlÓï¾ä
SQL code:
create table article
(
id int primary key auto_increment,
pid int,
rootid int,
title varchar(255),
cont text,
pdate datetime,
isleaf int #1-not leaf 0-leaf
)
auto_increment=0;
insert into article values (null, 0, 1, 'ÂìÒÏ´óÕ½´óÏó', 'ÂìÒÏ´óÕ½´óÏó', now(), 1);
insert into article values (null, 1, 1, '´óÏó±»´òÅ¿ÏÂÁË', '´óÏó±»´òÅ¿ÏÂÁË',now(), 1);
insert into article values (null, 2, 1, 'ÂìÒÏÒ²²»ºÃ¹ý','ÂìÒÏÒ²²»ºÃ¹ý', now(), 0);
insert into article values (null, 2, 1, 'Ϲ˵', 'Ϲ˵', now(), 1);
insert into article values (null, 4, 1, 'ûÓÐϹ˵', 'ûÓÐϹ˵', now(), 0);
insert into article values (null, 1, 1, 'Ôõô¿ÉÄÜ', 'Ôõô¿ÉÄÜ', now(), 1);
insert into article values (null, 6, 1, 'ÔõôûÓпÉÄÜ', 'ÔõôûÓпÉÄÜ', now(), 0);
insert into article values (null, 6, 1, '¿ÉÄÜÐÔÊǺܴóµÄ', '¿ÉÄÜÐÔÊǺܴóµÄ', now(), 0);
insert into article values (null, 2, 1, '´óÏó½øÒ½ÔºÁË', '´óÏó½øÒ½ÔºÁË', now(), 1);
insert into article values (null, 9, 1, '»¤Ê¿ÊÇÂìÒÏ', '»¤Ê¿ÊÇÂìÒÏ', now(), 0);
ΪʲôËüµÄid»¹ÊÇ´Ó1¿ªÊ¼Ôö³¤ÄØ£¿
ÔõÑùÉèÖÃËüµÄ×Ô¶¯Ôö³¤µÄÆðÊ¼ÖµÄØ£¿
auto_increment=0;
ÕâÀï²»ÊÇô£¿
¿ÉÊÇûÆðµ½×÷Óð¡ ¾ÍÊÇÕâÀïÓôÃÆÁË
ËüÀïÃæµÄÊý¾Ý»¹ÊÇ´Ó1¿ªÊ¼×Ô¶¯Ôö³¤
mysqlÈÃÐ޸IJ»àÞ£¿£¿£¿²»ÈÃÐ޸ľÍ×ÔÈϵ¹Ã¹°É¡£¡£¡£
create table article
(
id int primary key auto_increment,
ÎÒÔÚÇåÀímysqlµÄʱºò£¬Ò»²»ÁôÉñ½«mysql(¼´dataÀïµÄmysqlÎļþ¼Ð)Êý¾Ý¿â¸øÉ¾µôÁË£¬¸ôÁ˼¸¸öСʱÎÒÖØÆôÁËmysqlÈí¼þ£¬mysql¾Í×Ô¶¯³õʼ»¯ÁËÊý¾Ý¿â£¬µ¼Ö´Óɾ³ýmysqlÎļþ¼Ð¿ªÊ¼µ½ÖØÆôÕâ¶Îʱ¼äµÄÊý¾Ý¶ªÊ§£¬ÄÇλ¸ßÊÖ°ïÏëÏë°ì ......