将下列sql导入到mysql中即可,
sql将会创建项目必备的数据表结构
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: 2017-12-24 20:10:40
-- 服务器版本: 10.1.28-MariaDB
-- PHP Version: 5.6.32
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `ci_subway_system`
--
-- --------------------------------------------------------
--
-- 表的结构 `orders`
--
CREATE TABLE `orders` (
`order_id` int(11) NOT NULL,
`user_name` text NOT NULL,
`order_status` text NOT NULL,
`order_time` text NOT NULL,
`price` text,
`order_train` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- 转存表中的数据 `orders`
--
INSERT INTO `orders` (`order_id`, `user_name`, `order_status`, `order_time`, `price`, `order_train`) VALUES
(1, 'zuogewoniu', '1', '2017-12-07 09:25:02', '219', 'D121'),
(2, 'zuogewoniu', '1', '2017-12-06 19:25:02', '219', 'D121'),
(3, 'zuogewoniu', '1', '2017-12-03 12:25:02', '219', 'D121'),
(4, 'zuogewoniu', '1', '2017-12-10 22:25:10', '2', ''),
(5, 'zuogewoniu', '1', '2017-12-10 22:25:10', '219', 'D121'),
(6, 'zuogewoniu', '1', '2017-12-10 22:25:10', '219', 'D121'),
(7, 'zuogewoniu', '1', '2017-12-10 22:25:10', '219', 'D121'),
(8, 'zuogewoniu', '1', '2017-12-10 22:25:10', '219', 'D121'),
(9, '123', '1', '123', '123', 'undefined');
-- --------------------------------------------------------
--
-- 表的结构 `ticket`
--
CREATE TABLE `ticket` (
`id` int(11) NOT NULL,
`tid` int(11) NOT NULL,
`order_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- 表的结构 `ticket_info`
--
CREATE TABLE `ticket_info` (
`id` int(11) NOT NULL,
`tid` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`start_station` text NOT NULL,
`end_station` text NOT NULL,
`start_time` text NOT NULL,
`end_time` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- 表的结构 `train`
--
CREATE TABLE `train` (
`TID` int(11) NOT NULL,
`TrainNum` varchar(11) COLLATE utf8_unicode_ci NOT NULL,
`UID` int(11) NOT NULL,
`StartStation` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
`ArriStation` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
`StartTime` time NOT NULL,
`ArriTime` time NOT NULL,
`Date` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
`Price` int(11) NOT NULL,
`Car` int(11) NOT NULL,
`Mile` int(11) NOT NULL,
`Position` int(11) NOT NULL,
`Type` varchar(20) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- 转存表中的数据 `train`
--
INSERT INTO `train` (`TID`, `TrainNum`, `UID`, `StartStation`, `ArriStation`, `StartTime`, `ArriTime`, `Date`, `Price`, `Car`, `Mile`, `Position`, `Type`) VALUES
(260, 'D121', 4, '石家庄', '上海', '14:30:00', '19:31:00', '2017-12-24', 213, 1, 689, 6, '动车组'),
(261, 'D125', 4, '石家庄', '郑州', '14:30:00', '19:31:00', '2017-12-10', 213, 1, 689, 4, '动车组'),
(262, 'D124', 4, '石家庄', '武汉', '09:47:00', '18:30:00', '2017-12-10', 281, 1, 1200, 56, '动车组'),
(269, 'D121', 1, '石家庄', '上海', '17:47:00', '22:40:00', '2017-12-24', 213, 1, 689, 345, '火车组'),
(273, 'D121', 1, '石家庄', '上海', '09:47:00', '14:46:00', '2017-12-24', 213, 1, 689, 1, '火车组'),
(271, 'D121', 1, '石家庄', '上海', '19:47:00', '21:46:00', '2017-12-24', 213, 1, 689, 156, '火车组'),
(272, 'D124', 6, '石家庄', '武汉', '21:21:00', '06:15:00', '2011-01-01', 327, 1, 1454, 12, '火车组'),
(247, 'D124', 2, '石家庄', '武汉', '14:30:00', '20:31:00', '2011-01-01', 213, 1, 689, 23, '火车组'),
(266, 'D124', 4, '石家庄', '武汉', '10:47:00', '16:30:00', '2011-01-01', 281, 1, 1200, 124, '火车组'),
(265, 'D123', 4, '石家庄', '北京', '17:47:00', '20:30:00', '2011-01-01', 281, 1, 1200, 12, '火车组'),
(264, 'D123', 4, '石家庄', '北京', '14:30:00', '17:31:00', '2011-01-01', 213, 1, 689, 1, '火车组'),
(263, 'D123', 4, '石家庄', '北京', '09:30:00', '12:31:00', '2011-01-01', 213, 1, 689, 56, '火车组');
-- --------------------------------------------------------
--
-- 表的结构 `train_seats`
--
CREATE TABLE `train_seats` (
`sid` int(11) NOT NULL,
`seat_carriage` text,
`seat_x` text,
`seat_y` text,
`TID` text,
`seat_z` text NOT NULL,
`price` text,
`state` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- 转存表中的数据 `train_seats`
--
INSERT INTO `train_seats` (`sid`, `seat_carriage`, `seat_x`, `seat_y`, `TID`, `seat_z`, `price`, `state`) VALUES
(1, '1', '1', '1', '260', '', '216', '0'),
(2, '1', '2', '1', '260', '', '216', '1'),
(3, '1', '3', '1', '260', '', '216', '1'),
(4, '1', '4', '1', '260', '', '216', '0'),
(5, '1', '5', '1', '260', '', '216', '1'),
(6, '1', '6', '1', '260', '', '216', '0'),
(7, '1', '7', '1', '260', '', '216', '1'),
(8, '1', '1', '2', '260', '', '216', '0'),
(9, '1', '2', '2', '260', '', '216', '1'),
(10, '1', '3', '2', '260', '', '216', '0'),
(11, '1', '4', '2', '260', '', '216', '1'),
(12, '1', '5', '2', '260', '', '216', '0'),
(13, '1', '6', '2', '260', '', '216', '1'),
(14, '1', '7', '2', '260', '', '216', '1'),
(15, '1', '1', '3', '260', '', '216', '1'),
(16, '1', '2', '3', '260', '', '216', '1'),
(17, '1', '3', '3', '260', '', '216', '1'),
(18, '1', '4', '3', '260', '', '216', '1'),
(19, '1', '5', '3', '260', '', '216', '1'),
(20, '1', '6', '3', '260', '', '216', '1'),
(21, '1', '7', '3', '260', '', '216', '1'),
(22, '1', '1', '4', '260', '', '216', '1'),
(23, '1', '2', '4', '260', '', '216', '1'),
(24, '1', '3', '4', '260', '', '216', '1'),
(25, '1', '4', '4', '260', '', '216', '1'),
(26, '1', '5', '4', '260', '', '216', '1'),
(27, '1', '6', '4', '260', '', '216', '1'),
(28, '1', '7', '4', '260', '', '216', '1'),
(29, '1', '1', '5', '260', '', '216', '1'),
(30, '1', '2', '5', '260', '', '216', '1'),
(31, '1', '3', '5', '260', '', '216', '1'),
(32, '1', '4', '5', '260', '', '216', '1'),
(33, '1', '5', '5', '260', '', '216', '1'),
(34, '1', '6', '5', '260', '', '216', '1'),
(35, '1', '7', '5', '260', '', '216', '1'),
(36, '1', '1', '6', '260', '', '216', '1'),
(37, '1', '2', '6', '260', '', '216', '1'),
(38, '1', '3', '6', '260', '', '216', '1'),
(39, '1', '4', '6', '260', '', '216', '1'),
(40, '1', '5', '6', '260', '', '216', '1'),
(41, '1', '6', '6', '260', '', '216', '1'),
(42, '1', '7', '6', '260', '', '216', '1'),
(43, '2', '3', '1', '260', '', '216', '1'),
(44, '2', '4', '1', '260', '', '216', '1'),
(45, '2', '5', '1', '260', '', '216', '1'),
(46, '2', '6', '1', '260', '', '216', '1'),
(47, '2', '7', '1', '260', '', '216', '1'),
(48, '2', '1', '2', '260', '', '216', '1'),
(49, '2', '2', '2', '260', '', '216', '1'),
(50, '2', '3', '2', '260', '', '216', '1'),
(51, '2', '4', '2', '260', '', '216', '1'),
(52, '2', '5', '2', '260', '', '216', '1'),
(53, '2', '6', '2', '260', '', '216', '1'),
(54, '2', '7', '2', '260', '', '216', '1'),
(55, '2', '1', '3', '260', '', '216', '1'),
(56, '2', '2', '3', '260', '', '216', '1'),
(57, '2', '3', '3', '260', '', '216', '1'),
(58, '2', '4', '3', '260', '', '216', '1'),
(59, '2', '5', '3', '260', '', '216', '1'),
(60, '2', '6', '3', '260', '', '216', '1'),
(61, '2', '7', '3', '260', '', '216', '1'),
(62, '2', '1', '4', '260', '', '216', '1'),
(63, '2', '2', '4', '260', '', '216', '1'),
(64, '2', '3', '4', '260', '', '216', '1'),
(65, '2', '4', '4', '260', '', '216', '1'),
(66, '2', '5', '4', '260', '', '216', '1'),
(67, '2', '6', '4', '260', '', '216', '1'),
(68, '2', '7', '4', '260', '', '216', '1'),
(69, '2', '1', '5', '260', '', '216', '1'),
(70, '2', '2', '5', '260', '', '216', '1'),
(71, '2', '3', '5', '260', '', '216', '1'),
(72, '2', '4', '5', '260', '', '216', '1'),
(73, '2', '5', '5', '260', '', '216', '1'),
(74, '2', '6', '5', '260', '', '216', '1'),
(75, '2', '7', '5', '260', '', '216', '1'),
(76, '2', '1', '6', '260', '', '216', '1'),
(77, '2', '2', '6', '260', '', '216', '1'),
(78, '2', '3', '6', '260', '', '216', '1'),
(79, '2', '4', '6', '260', '', '216', '1'),
(80, '2', '5', '6', '260', '', '216', '1'),
(81, '2', '6', '6', '260', '', '216', '1'),
(82, '2', '7', '6', '260', '', '216', '1'),
(83, '1', '3', '1', '269', '', NULL, '1'),
(84, '1', '4', '1', '269', '', NULL, '1'),
(85, '1', '5', '1', '269', '', NULL, '1'),
(86, '1', '6', '1', '269', '', NULL, '1'),
(87, '1', '7', '1', '269', '', NULL, '1'),
(88, '1', '1', '2', '269', '', NULL, '1'),
(89, '1', '2', '2', '269', '', NULL, '1'),
(90, '1', '3', '2', '269', '', NULL, '1'),
(91, '1', '4', '2', '269', '', NULL, '1'),
(92, '1', '5', '2', '269', '', NULL, '1'),
(93, '1', '6', '2', '269', '', NULL, '1'),
(94, '1', '7', '2', '269', '', NULL, '1'),
(95, '1', '1', '3', '269', '', NULL, '1'),
(96, '1', '2', '3', '269', '', NULL, '1'),
(97, '1', '3', '3', '269', '', NULL, '1'),
(98, '1', '4', '3', '269', '', NULL, '1'),
(99, '1', '5', '3', '269', '', NULL, '0'),
(100, '1', '6', '3', '269', '', NULL, '1'),
(101, '1', '7', '3', '269', '', NULL, '0'),
(102, '1', '1', '4', '269', '', NULL, '1'),
(103, '1', '2', '4', '269', '', NULL, '0'),
(104, '1', '3', '4', '269', '', NULL, '1'),
(105, '1', '4', '4', '269', '', NULL, '0'),
(106, '1', '5', '4', '269', '', NULL, '1'),
(107, '1', '6', '4', '269', '', NULL, '0'),
(108, '1', '7', '4', '269', '', NULL, '1'),
(109, '1', '1', '5', '269', '', NULL, '1'),
(110, '1', '2', '5', '269', '', NULL, '1'),
(111, '1', '3', '5', '269', '', NULL, '1'),
(112, '1', '4', '5', '269', '', NULL, '1'),
(113, '1', '5', '5', '269', '', NULL, '1'),
(114, '1', '6', '5', '269', '', NULL, '1'),
(115, '1', '7', '5', '269', '', NULL, '1'),
(116, '1', '1', '6', '269', '', NULL, '1'),
(117, '1', '2', '6', '269', '', NULL, '1'),
(118, '1', '3', '6', '269', '', NULL, '1'),
(119, '1', '4', '6', '269', '', NULL, '1'),
(120, '1', '5', '6', '269', '', NULL, '1'),
(121, '1', '6', '6', '269', '', NULL, '1'),
(122, '1', '7', '6', '269', '', NULL, '1'),
(123, '2', '3', '1', '269', '', NULL, '1'),
(124, '2', '4', '1', '269', '', NULL, '1'),
(125, '2', '5', '1', '269', '', NULL, '1'),
(126, '2', '6', '1', '269', '', NULL, '1'),
(127, '2', '7', '1', '269', '', NULL, '1'),
(128, '2', '1', '2', '269', '', NULL, '1'),
(129, '2', '2', '2', '269', '', NULL, '1'),
(130, '2', '3', '2', '269', '', NULL, '1'),
(131, '2', '4', '2', '269', '', NULL, '1'),
(132, '2', '5', '2', '269', '', NULL, '1'),
(133, '2', '6', '2', '269', '', NULL, '1'),
(134, '2', '7', '2', '269', '', NULL, '1'),
(135, '2', '1', '3', '269', '', NULL, '1'),
(136, '2', '2', '3', '269', '', NULL, '1'),
(137, '2', '3', '3', '269', '', NULL, '1'),
(138, '2', '4', '3', '269', '', NULL, '1'),
(139, '2', '5', '3', '269', '', NULL, '1'),
(140, '2', '6', '3', '269', '', NULL, '1'),
(141, '2', '7', '3', '269', '', NULL, '1'),
(142, '2', '1', '4', '269', '', NULL, '1'),
(143, '2', '2', '4', '269', '', NULL, '1'),
(144, '2', '3', '4', '269', '', NULL, '1'),
(145, '2', '4', '4', '269', '', NULL, '1'),
(146, '2', '5', '4', '269', '', NULL, '1'),
(147, '2', '6', '4', '269', '', NULL, '1'),
(148, '2', '7', '4', '269', '', NULL, '1'),
(149, '2', '1', '5', '269', '', NULL, '1'),
(150, '2', '2', '5', '269', '', NULL, '1'),
(151, '2', '3', '5', '269', '', NULL, '1'),
(152, '2', '4', '5', '269', '', NULL, '1'),
(153, '2', '5', '5', '269', '', NULL, '1'),
(154, '2', '6', '5', '269', '', NULL, '1'),
(155, '2', '7', '5', '269', '', NULL, '1'),
(156, '2', '1', '6', '269', '', NULL, '1'),
(157, '2', '2', '6', '269', '', NULL, '1'),
(158, '2', '3', '6', '269', '', NULL, '1'),
(159, '2', '4', '6', '269', '', NULL, '1'),
(160, '2', '5', '6', '269', '', NULL, '1'),
(161, '2', '6', '6', '269', '', NULL, '1'),
(162, '2', '7', '6', '269', '', NULL, '1'),
(163, '3', '1', '1', '260', '1', '490', '1'),
(164, '3', '1', '1', '260', '2', '460', '1'),
(165, '3', '1', '1', '260', '3', '400', '1'),
(166, '3', '2', '1', '260', '1', '490', '1'),
(167, '3', '2', '1', '260', '2', '460', '1'),
(168, '3', '2', '1', '260', '3', '400', '1'),
(169, '3', '1', '2', '260', '1', '490', '1'),
(170, '3', '1', '2', '260', '2', '460', '1'),
(171, '3', '1', '2', '260', '3', '400', '1'),
(172, '3', '2', '2', '260', '1', '490', '1'),
(173, '3', '2', '2', '260', '2', '460', '1'),
(174, '3', '2', '2', '260', '3', '400', '1');
-- --------------------------------------------------------
--
-- 表的结构 `user`
--
CREATE TABLE `user` (
`id` int(11) NOT NULL,
`user_id` text,
`user_name` text,
`pass_word` text,
`role` text,
`card_id` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='用户表:包括顾客和管理员';
--
-- 转存表中的数据 `user`
--
INSERT INTO `user` (`id`, `user_id`, `user_name`, `pass_word`, `role`, `card_id`) VALUES
(1, '1580000001', 'zuogewoniu', '123', '1', '1588888888881'),
(2, '1580000002', 'chaofan', '123', '2', '1588888888882'),
(7, '1580000003', 'chaofan2', '123', '0', '15834568822222'),
(8, '1580000008', 'chaofan5', '123', '0', '158345688888555'),
(9, '1580000009', 'chaofan6', '123', '0', '15834568886666'),
(10, '1580000010', 'chaofan8', '123', '0', '15834568888888288'),
(11, '159000000011', 'zuogewoniu@qq.com', '123123', '1', '158920938102938098');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `orders`
--
ALTER TABLE `orders`
ADD PRIMARY KEY (`order_id`);
--
-- Indexes for table `ticket`
--
ALTER TABLE `ticket`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `ticket_info`
--
ALTER TABLE `ticket_info`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `train`
--
ALTER TABLE `train`
ADD PRIMARY KEY (`TID`);
--
-- Indexes for table `train_seats`
--
ALTER TABLE `train_seats`
ADD PRIMARY KEY (`sid`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`);
--
-- 在导出的表使用AUTO_INCREMENT
--
--
-- 使用表AUTO_INCREMENT `orders`
--
ALTER TABLE `orders`
MODIFY `order_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- 使用表AUTO_INCREMENT `ticket`
--
ALTER TABLE `ticket`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- 使用表AUTO_INCREMENT `ticket_info`
--
ALTER TABLE `ticket_info`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- 使用表AUTO_INCREMENT `train`
--
ALTER TABLE `train`
MODIFY `TID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=274;
--
-- 使用表AUTO_INCREMENT `train_seats`
--
ALTER TABLE `train_seats`
MODIFY `sid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=175;
--
-- 使用表AUTO_INCREMENT `user`
--
ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;