sql代码
-- phpMyAdmin SQL Dump-- version 2.11.6-- http://www.phpmyadmin.net---- 主机: localhost-- 生成日期: 2011 年 06 月 18 日 16:49-- 服务器版本: 5.0.51-- PHP 版本: 5.2.6SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";---- 数据库: `feng`---- ------------------------------------------------------------ 表的结构 `fsl_class`--CREATE TABLE `fsl_class` ( `id` int(5) NOT NULL auto_increment, `catPath` varchar(100) collate utf8_unicode_ci NOT NULL, `title` varchar(100) collate utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=8 ;---- 导出表中的数据 `fsl_class`--INSERT INTO `fsl_class` (`id`, `catPath`, `title`) VALUES(1, '0', '网站首页'),(2, '0-1', 'linuxos'),(3, '0-1', 'apache'),(4, '0-1', 'mysql'),(5, '0-1', 'php'),(6, '0-1-2', 'linux系统'),(7, '0-1-2', 'linux网络');
php页面代码
query("select id,concat(catPath,'-',id) as absPath,title from fsl_class order by absPath,id");$record=array();while($row=$result->fetch_assoc()){$record[]=$row;} $result=$mysqli->query("select id,concat(catPath,'-',id) as absPath,title from fsl_class order by absPath,id"); echo ''; $result->close(); $mysqli->close(); $v_arr=explode("|",$_POST["ft"]); echo $v_arr[0].""; echo $v_arr[1].""; ?>