Tested (table structure: id Table ID (unique) title: ID of the flid category of various titles (Category 1: Class 2: Class 3) ID of the class on the pid (category is followed by category, when submitting a class, write the class ID here, and when submitting a small class, write the class ID ))
<? Php $ link = mysql_connect ("localhost", "root", "root") or die ("database server connection error ". mysql_error (); mysql_select_db ("sanji", $ link) or die ("database access error ". mysql_error (); mysql_query ("set character set gb2312"); mysql_query ("set names gb2312");?> <Html>
Database called "sanji" -- phpMyAdmin SQL Dump -- version 2.11.4 -- http://www.phpmyadmin.net ---- host: localhost -- generation date: November 03, 2009 -- Server version: 5.0.51 -- PHP version: 5.2.5SET SQL _MODE = "NO_AUTO_VALUE_ON_ZERO "; ---- database: 'sanji' ---- -------------------------------------------------------- TABLE structure 'sanji' -- create table if not exists 'sanji '('id' int (10) not null auto_increment, 'title' varchar (30) collate utf8_unicode_ci not null, 'flid' int (10) not null, 'pid 'int (10) not null, primary key ('id ')) ENGINE = MyISAM default charset = utf8 COLLATE = utf8_unicode_ci AUTO_INCREMENT = 5; ---- export the data in the table 'sanji' -- insert into 'sanji' ('id', 'title ', 'flid', 'pid ') VALUES (1,' I am 1', 1, 1), (2, 'I am 2, belongs to 1 Cano', 2, 1), (3, 'I am 3, belong to 2 authorization', 3, 2), (4,' I am 4, also belong to 2 authorization', 3, 2 );