-- http://www.phpmyadmin.net
--




--
-- Database: `db_marketplace`
--

-- --------------------------------------------------------

--
-- Table structure for table `tb_comment_product`
--

CREATE TABLE IF NOT EXISTS `tb_comment_product` (
  `c_id` int(5) NOT NULL,
  `p_id` int(5) NOT NULL,
  `m_id` int(5) NOT NULL,
  `c_detail` text NOT NULL,
  `c_date` varchar(20) NOT NULL,
  `c_time` varchar(20) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tb_comment_product`
--

INSERT INTO `tb_comment_product` (`c_id`, `p_id`, `m_id`, `c_detail`, `c_date`, `c_time`) VALUES
(2, 17, 9, 'โอเค\n', '26-02-2016', '10:10:39'),
(3, 17, 9, 'tast1\n', '26-02-2016', '10:11:26'),
(4, 19, 10, 'โอมกาก', '26-02-2016', '10:29:35'),
(10, 25, 11, 'Test 1', '01-03-2016', '16:01:28'),
(11, 25, 11, 'Test 2', '01-03-2016', '16:01:35'),
(12, 25, 11, 'Test 3', '01-03-2016', '16:01:59'),
(13, 25, 11, 'test 4', '01-03-2016', '16:02:06'),
(14, 28, 11, 'tese\n', '07-03-2016', '16:14:07'),
(18, 30, 11, 'test 1', '07-03-2016', '18:15:02'),
(19, 30, 11, 'test 2', '07-03-2016', '18:15:08'),
(20, 30, 11, 'test 3', '07-03-2016', '18:15:13'),
(22, 25, 11, 'test 5', '08-03-2016', '02:04:20'),
(23, 25, 11, 'test 6', '08-03-2016', '02:04:29'),
(24, 25, 11, 'test 6', '08-03-2016', '02:04:37'),
(25, 25, 11, 'test 7', '08-03-2016', '02:04:50'),
(26, 26, 16, 'สินค้า1', '10-03-2016', '15:11:41'),
(27, 26, 16, 'kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk', '10-03-2016', '15:12:03'),
(28, 47, 11, '11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111', '10-03-2016', '18:33:03'),
(29, 48, 17, 'สินค้าน่าสนใจ', '11-03-2016', '16:52:35'),
(30, 46, 11, 'ถูกใจ', '17-03-2016', '09:53:58'),
(31, 33, 11, '1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111', '31-03-2016', '23:04:54'),
(32, 27, 14, 'sdfsdfd', '01-04-2016', '16:07:51'),
(33, 27, 14, '11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111', '01-04-2016', '16:46:32'),
(34, 49, 19, 'ไไไไไไไไไไไไไไไไไไdsaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', '01-04-2016', '16:53:53'),
(35, 49, 19, 'ะพเเเะพdooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo', '01-04-2016', '16:54:17'),
(36, 52, 1, 'ทดสอบระบบ 1', '01-04-2016', '17:46:20'),
(37, 52, 19, 'ทดสอบระบบ2', '01-04-2016', '17:46:40'),
(38, 53, 20, 'ทดสอบระบบ 1/4/58', '01-04-2016', '18:02:04'),
(39, 61, 19, 'ทดสอบระบบ 1', '02-04-2016', '16:12:52'),
(40, 61, 19, 'ทดสอบระบบ 2', '02-04-2016', '16:12:58'),
(41, 61, 19, 'ทดสอบระบบ 3', '02-04-2016', '16:13:03'),
(42, 65, 19, 'ทดสอบระบบ1', '04-04-2016', '19:19:07'),
(43, 59, 22, 'ทดสอบระบบ', '05-04-2016', '10:46:04'),
(44, 59, 22, 'ทดสอบ2', '05-04-2016', '10:46:15'),
(45, 66, 22, 'ทดสอบ', '05-04-2016', '10:54:37'),
(46, 66, 19, 'ทดสอบ2', '05-04-2016', '10:57:26'),
(47, 66, 1, 'admin', '05-04-2016', '11:00:52');

-- --------------------------------------------------------

--
-- Table structure for table `tb_images`
--

CREATE TABLE IF NOT EXISTS `tb_images` (
  `i_id` int(10) NOT NULL,
  `file_name` varchar(50) NOT NULL,
  `p_id` int(5) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=87 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tb_images`
--

INSERT INTO `tb_images` (`i_id`, `file_name`, `p_id`) VALUES
(1, 'car.png', 15),
(2, '219bfd46973750486b70df67152e80aa.jpg', 17),
(3, '14564029660031595415224.jpg', 18),
(4, '14564031630431102985143.jpg', 19),
(5, '145640319765223904150.jpg', 19),
(6, '42538_1330310945.jpg', 21),
(7, 'K0000304303_0002.jpg', 22),
(8, '1.jpg', 25),
(9, '2.jpg', 25),
(10, '555.jpg', 26),
(11, '6666.jpg', 27),
(12, 'images.jpg', 28),
(14, 'Acer_Aspire_E5_471_L_3.jpg', 29),
(15, 'Acer_Aspire_E5_471_L_2.jpg', 29),
(16, 'HP_Pavilion_14_e006tx_L_1.jpg', 30),
(17, 'HP_Pavilion_14_e006tx_L_2.jpg', 30),
(18, 'HP_Pavilion_14_e006tx_L_3.jpg', 30),
(19, '27', 31),
(20, '29', 32),
(21, '30', 33),
(22, '1457431999721-1561927306.jpg', 34),
(23, '1457432054272-1105439980.jpg', 34),
(24, '1457431999721-1561927306.jpg', 35),
(25, 'images.jpg', 36),
(26, 'images.jpg', 37),
(27, 'images.jpg', 38),
(28, 'tv2.jpg', 39),
(29, '1457442083155-981988170.jpg', 40),
(30, '1457442111828684159306.jpg', 40),
(31, '14574421291161084736621.jpg', 40),
(32, '20160308_201519.jpg', 41),
(33, '20160308_202310.jpg', 42),
(34, '1457443833268-981988170.jpg', 43),
(35, '1457443869223684159306.jpg', 43),
(36, '14574439009601084736621.jpg', 43),
(37, '20160308_203704.jpg', 44),
(38, '1457454961718-319418461.jpg', 45),
(39, '1457455032219240613515.jpg', 45),
(40, '1457455467033-585873413.jpg', 46),
(41, '1457455482612-187110612.jpg', 46),
(42, '14574555001471439559617.jpg', 46),
(43, '30', 47),
(44, '30', 47),
(45, '30', 48),
(46, '31', 46),
(47, 'dd.jpg', 46),
(48, 'kk.jpg', 47),
(49, 'dd.jpg', 48),
(50, '30', 49),
(51, '16', 50),
(52, '31', 51),
(53, '31', 52),
(54, '30', 52),
(55, '625cebca373be8cd99e67b990a790a8b_1.jpg', 53),
(56, 'EFA-121D-1AVDF.jpg', 54),
(57, 'EFA-121D-1AVDF.jpg', 54),
(58, 'EFA-121D-1AVDF.jpg', 54),
(59, 'images.jpg', 55),
(60, 'Acer_Aspire_V3_471G_53214G75Ma_L_1.jpg', 56),
(61, 'nb130.jpg', 56),
(63, 'Acer_Aspire_V3_471G_53214G75Ma_L_1.jpg', 56),
(64, 'nb130.jpg', 56),
(66, 'nb3.jpg', 57),
(67, 'nb2.jpg', 57),
(68, 'nb4.jpg', 57),
(69, '537c6850a18994f90a00000a-0-20140521154816-f3ccdd27', 58),
(70, '537c6850a18994f90a00000a-2-20140521154816-799bad5a', 58),
(71, 'hi1.jpg', 59),
(72, 'hi2.jpg', 59),
(73, 'hero2.jpg', 60),
(74, 'hero1.jpg', 60),
(75, 'b1.jpg', 61),
(76, 'hi1.jpg', 61),
(77, 'IMG_20160310_180706.jpg', 62),
(78, '35', 63),
(79, '36', 63),
(80, 'asus1.jpg', 64),
(81, 'asus2.jpg', 64),
(82, 'asus3.jpg', 64),
(83, 'gs1.jpg', 65),
(84, 'gs2.jpg', 65),
(85, '37', 66),
(86, '38', 66);

-- --------------------------------------------------------

--
-- Table structure for table `tb_like`
--

CREATE TABLE IF NOT EXISTS `tb_like` (
  `l_id` int(5) NOT NULL,
  `p_id` int(5) NOT NULL,
  `m_id` varchar(5) NOT NULL,
  `l_like` int(5) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tb_like`
--

INSERT INTO `tb_like` (`l_id`, `p_id`, `m_id`, `l_like`) VALUES
(1, 15, '1', 1),
(2, 17, '9', 1),
(3, 19, '10', 1),
(4, 25, '11', 1),
(5, 28, '11', 1),
(6, 30, '11', 1),
(7, 36, '11', 1),
(8, 26, '16', 1),
(9, 48, '17', 1),
(10, 31, '18', 1),
(11, 46, '11', 1),
(12, 33, '11', 1),
(13, 49, '19', 1),
(14, 51, '19', 1),
(15, 52, '19', 1),
(16, 52, '1', 1),
(17, 53, '20', 1),
(18, 57, '19', 1),
(19, 60, '20', 1),
(20, 60, '19', 1),
(21, 59, '19', 1),
(22, 61, '1', 1),
(23, 61, '19', 1),
(24, 65, '19', 1),
(25, 59, '22', 1),
(26, 66, '22', 1);

-- --------------------------------------------------------

--
-- Table structure for table `tb_product`
--

CREATE TABLE IF NOT EXISTS `tb_product` (
  `p_id` int(5) NOT NULL,
  `m_id` varchar(10) NOT NULL,
  `t_id` int(5) NOT NULL,
  `p_name` varchar(200) NOT NULL,
  `p_detail` text NOT NULL,
  `p_price` int(10) NOT NULL,
  `file_name` varchar(50) NOT NULL,
  `p_date` varchar(20) NOT NULL,
  `p_view` int(10) NOT NULL,
  `p_like` int(5) NOT NULL,
  `p_add_address` varchar(255) NOT NULL,
  `p_add_tel` varchar(20) NOT NULL,
  `p_add_line` varchar(255) NOT NULL,
  `p_add_face` varchar(255) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=67 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tb_product`
--

INSERT INTO `tb_product` (`p_id`, `m_id`, `t_id`, `p_name`, `p_detail`, `p_price`, `file_name`, `p_date`, `p_view`, `p_like`, `p_add_address`, `p_add_tel`, `p_add_line`, `p_add_face`) VALUES
(16, '1', 15, 's6', 'ใช้งานปกติ', 12000, 'phone.jpg', '25-02-2016', 1, 0, '', '', '', ''),
(20, '1', 16, 'iphone', 'ใช้งานปกติ มีรอยเคสกัดนิดหน่อย', 5900, '219bfd46973750486b70df67152e80aa.jpg', '26-02-2016', 1, 0, '', '', '', ''),
(21, '1', 14, 'รถเก๋งสภาพดี', 'รถใช้มือเดียว อีกมือดึงประตู', 250000, '42538_1330310945.jpg', '26-02-2016', 2, 0, '', '', '', ''),
(22, '1', 17, 'โน็ตบุ๊ค acer', 'ใช้งานปกติ core i5  Ram 4G  ', 9000, 'K0000304303_0002.jpg', '26-02-2016', 2, 0, '', '', '', ''),
(23, '9', 17, 'โน็ตบุ๊ค asus', 'Corei5\r\nRam 4G\r\nVGA 2G', 12000, '1456411730930.jpg', '26-02-2016', 1, 0, '', '', '', ''),
(24, '1', 18, 'โน็ตบุ๊ค asus', 'core i5  Ram 4g  vga 2g', 19000, '1359101738ASUS-VivoBook-U38N-13.3-Inch-Touchscreen', '29-02-2016', 1, 0, '', '', '', ''),
(52, '19', 20, 'Samsung galagy win', 'ใช้งานปกติซื้อมาเเค่1เดือน', 3900, '31', '01-04-2016', 3, 0, 'ขอนแก่น', '0806930686', 'aapache', 'narongrit rintarach'),
(53, '20', 22, 'พัดลม Hatari', 'พัดลม Hatari 18"', 350, '625cebca373be8cd99e67b990a790a8b_1.jpg', '01-04-2016', 1, 0, 'มหาสารคาม', '0806930686', 'danonsomeone', 'Narong Rintarach'),
(54, '20', 21, 'นาฬิกา casio', 'นาฬิกา คาสิโอ Edifice รุ่น EFA-121D-1AVDF  ใช้งานปกติ', 3500, 'EFA-121D-1AVDF.jpg', '01-04-2016', 2, 0, 'อำเภอเมือง มหาสารคาม', '043823551', 'danonsomeone', 'Narongrit Rintarach'),
(57, '20', 19, 'โน็ตบุ๊ค acer aspire 471', 'Core i3\r\nRam 4g\r\nVGA 2g', 6900, 'nb3.jpg', '01-04-2016', 1, 0, 'จังหวัดกาฬสินธุ์', '0806930686', 'danonsomeone', 'Narongrit Rintarach'),
(59, '20', 22, 'ตู้เย็น HITACHI', 'ต้องการขายตู้เย็น HITACHI ขนาด 1.7 คิว/49ลิตร ขนย้ายสะดวก สภาพใหม่มาก', 2000, 'hi1.jpg', '02-04-2016', 1, 0, 'ขอนแก่น', '0806930686', 'danonsomeone', 'Narongrit Rintarach'),
(60, '20', 20, 'Samsung Hero3G', 'ซัมซุง ฮีโร่ รองรับ 3จี ', 400, 'hero2.jpg', '02-04-2016', 1, 0, 'อำเภอเมือง มหาสารคาม', '0806930686', 'Narongrit', 'Narongrit Rintarach'),
(61, '19', 22, 'หม้อหุงข้าว', 'หม้อหุงข้าว ใช้งานปกติ ประหยัดไฟเบอร์ 5', 800, 'b1.jpg', '02-04-2016', 3, 0, 'มหาสารคาม', '0806930686', 'Narongrit', 'Narongrit Rintarach'),
(63, '19', 20, 'iPhone SE', 'สินค้ามือหนึ่งประกัน1ปี', 14900, '35', '04-04-2016', 1, 0, 'กรุงเทพ', '021234567', 'admin', 'admin'),
(64, '19', 19, 'โน๊ตบุ๊ค Asus', 'โน๊ตบุ๊ค Asus K450CC-WX171D', 9900, 'asus1.jpg', '04-04-2016', 1, 0, 'กรุงเทพ', '0212345678', 'admin', 'admin'),
(65, '19', 21, 'นาฬิกา Casio G-Shock', 'ใช้งานตกติ มีเสียง มีไฟ', 1500, 'gs1.jpg', '04-04-2016', 2, 0, 'จังหวัดกาฬสินธุ์', '0212345678', 'admin', 'admin'),
(66, '22', 20, 'ไอเพท', 'ใช้งานปกติ', 5000, '37', '05-04-2016', 3, 0, 'มหาสารคาม', '0812345678', 'ohm', 'ไนยชน');

-- --------------------------------------------------------

--
-- Table structure for table `tb_type_product`
--

CREATE TABLE IF NOT EXISTS `tb_type_product` (
  `t_id` int(5) NOT NULL,
  `t_name` varchar(100) NOT NULL,
  `t_icon` varchar(50) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tb_type_product`
--

INSERT INTO `tb_type_product` (`t_id`, `t_name`, `t_icon`) VALUES
(19, 'โน็ตบุ๊ค', '1.jpg'),
(20, 'โทรศัพท์มือถือ', 'a7hj79jk7he5bejka77ee.jpg'),
(21, 'นาฬิกาข้อมือ', '6666.jpg'),
(22, 'เครื่องใช้ไฟฟ้า', '2x.jpg'),
(23, 'รถยนต์', 'kk.jpg');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `tb_comment_product`
--
ALTER TABLE `tb_comment_product`
  ADD PRIMARY KEY (`c_id`);

--
-- Indexes for table `tb_images`
--
ALTER TABLE `tb_images`
  ADD PRIMARY KEY (`i_id`);

--
-- Indexes for table `tb_like`
--
ALTER TABLE `tb_like`
  ADD PRIMARY KEY (`l_id`);

--
-- Indexes for table `tb_product`
--
ALTER TABLE `tb_product`
  ADD PRIMARY KEY (`p_id`);

--
-- Indexes for table `tb_type_product`
--
ALTER TABLE `tb_type_product`
  ADD PRIMARY KEY (`t_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `tb_comment_product`
--
ALTER TABLE `tb_comment_product`
  MODIFY `c_id` int(5) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=48;
--
-- AUTO_INCREMENT for table `tb_images`
--
ALTER TABLE `tb_images`
  MODIFY `i_id` int(10) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=87;
--
-- AUTO_INCREMENT for table `tb_like`
--
ALTER TABLE `tb_like`
  MODIFY `l_id` int(5) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=27;
--
-- AUTO_INCREMENT for table `tb_product`
--
ALTER TABLE `tb_product`
  MODIFY `p_id` int(5) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=67;
--
-- AUTO_INCREMENT for table `tb_type_product`
--
ALTER TABLE `tb_type_product`
  MODIFY `t_id` int(5) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=24;
