mysql结构如下:
-- phpMyAdmin SQL Dump -- version 4.4.1.1 -- http://www.phpmyadmin.net -- -- Host: localhost:8889 -- Generation Time: 2015-06-23 16:40:20 -- 服务器版本: 5.5.42 -- PHP Version: 5.6.7 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; -- -- Database: `php100` -- -- -------------------------------------------------------- -- -- 表的结构 `news` -- CREATE TABLE `news` ( `id` int(5) NOT NULL, `title` varchar(50) NOT NULL, `dates` date NOT NULL, `contents` text NOT NULL, `hits` int(11) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8; -- -- 转存表中的数据 `news` -- INSERT INTO `news` (`id`, `title`, `dates`, `contents`, `hits`) VALUES (1, 't', '2015-06-01', 'ttttt', 0), (2, '1111', '2015-06-23', '1111汉字这是一个微博客系统。', 1), (10, '1111', '2015-06-23', '222222222222222', 0), (11, 'aaa', '2015-06-23', 'vavavavavvsss', 6), (12, '中文', '2015-06-23', '中文中文中文中文中文中文', 0); -- -- Indexes for dumped tables -- -- -- Indexes for table `news` -- ALTER TABLE `news` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `news` -- ALTER TABLE `news` MODIFY `id` int(5) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=13;
其他php代码见附件。下载源码