|
|
|
อยากทรงรายชื่อข้อมูลห้องไปแก้ไขจากหน้าจัดการห้องพักไปยังหน้าแก้ไข |
|
|
|
|
|
|
|
ขอโครงสร้างของ Table และรายละเอียดเพิ่มเติมมากกว่านี้หน่อยครับ
|
|
|
|
|
Date :
2015-03-30 07:33:56 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
คือห้องพัก ในแต่ละชั้นจะมีจำนวนไม่เหมือนกัน ผมเลยใช้การประกาศ SQL แบบทีละห้องเลย ( ไม่ทราบเหมือนกันว่ามันเป็ฯวิธีที่ดีไหม ) และ ผมต้องการ ให้ ผู้ใช้ คลิ๊กผ่าน ห้องที่ตั้งชื่อไว้ เช่น คลิ๊ก ห้อง A201 ก็จะดึง ข้อมูลผู้ที่อยู่ A201 โดย ชื่อห้อง เป็น room.room_value และ มี id กำกับ ไว้ room.id โดยต้องดึงข้อมูลจาก ตาราง 3 ตาราง ชื่อ member ที่ member.member_id = room_sys.member_id และ room_sys.room_id = room.id
Code (SQL)
-- phpMyAdmin SQL Dump
-- version 2.10.3
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 30, 2015 at 06:02 PM
-- Server version: 5.0.51
-- PHP Version: 5.2.6
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `dmss`
--
-- --------------------------------------------------------
--
-- Table structure for table `members`
--
CREATE TABLE `members` (
`username` varchar(20) default NULL,
`password` varchar(20) default NULL,
`images` varchar(255) default NULL,
`titlename` varchar(5) default NULL,
`name` varchar(30) default NULL,
`surname` varchar(30) default NULL,
`e_name` varchar(30) default NULL,
`e_surname` varchar(30) default NULL,
`birth_day` date default NULL,
`yearold` int(3) default NULL,
`id_card` varchar(17) default NULL,
`nationality` varchar(20) default NULL,
`s_nationality` varchar(20) default NULL,
`religious` varchar(20) default NULL,
`fa_name` varchar(30) default NULL,
`fa_surname` varchar(30) default NULL,
`fa_job` varchar(20) default NULL,
`ma_name` varchar(30) default NULL,
`ma_surname` varchar(30) default NULL,
`ma_job` varchar(20) default NULL,
`status_fa_ma` varchar(30) default NULL,
`member_id` varchar(12) NOT NULL,
`stu_year` int(1) default NULL,
`faculty` varchar(30) default NULL,
`field` varchar(30) default NULL,
`teacher` varchar(50) default NULL,
`tel_teacher` varchar(10) default NULL,
`tel` varchar(12) default NULL,
`tel_emergency` varchar(10) default NULL,
`name_emergency` varchar(30) default NULL,
`fa_tel` varchar(12) default NULL,
`ma_tel` varchar(12) default NULL,
`pr_tel` varchar(12) default NULL,
`pr_name` varchar(30) default NULL,
`pr_relationship` varchar(10) default NULL,
`email` varchar(40) default NULL,
`social` varchar(40) default NULL,
`address` varchar(150) default NULL,
`address_idcard` varchar(200) default NULL,
`blood` varchar(2) default NULL,
`disease` varchar(10) default NULL,
`name_disease` varchar(30) default NULL,
`heal_disease` varchar(500) default NULL,
`medicine` varchar(10) default NULL,
`name_medicine` varchar(20) default NULL,
`status` varchar(10) default NULL,
PRIMARY KEY (`member_id`)
) ENGINE=MyISAM DEFAULT CHARSET=tis620;
--
-- Dumping data for table `members`
--
INSERT INTO `members` VALUES ('asdfasdf', '123123', 'add_button_1-128.png', 'นาย', '33333', '11', 'sadfadsf', 'sadfasdfdsfsdfsdfsdfsdf', '1990-12-01', 11, '123123123', 'fdsgdf', 'gdfgsdfg', 'dfgsdfg', 'dsfgdfg', 'dsfgsdfg', 'dfgdfgfd', 'gdsfgdg', 'dfgdfgf', 'sdgdsgdsg', 'หย่าร้าง', '123123123', 3, 'fgsdfg', 'sdfgsdfg', 'dfgdsfg', '5654645', '123', '321', '111', 'asdf', 'asdf', '111', '111', 'fghfgh', '111', '111', 'sdf', 'asdf', 'O', 'ไม่มี', 'sdaf', 'dsf', 'ไม่มี', 'sdf', 'USER');
INSERT INTO `members` VALUES ('jirawinss', '123456', 'jirawin.png', 'นาย', 'จิระวิน', 'แซ่โฉ่ง', 'Jirawin', 'Sarechong', '1990-01-21', 25, '5571500011068', 'จีน', 'ไทย', 'คริสต์', 'เซียะเหวิน', 'แซ่โฉ่ง', 'ขายชา', 'จินตานา', 'เด่นเกสินีจินดา', 'ครู', 'แยกกันอยู่', '5401290080', 4, 'บริหารธุรกิจ', 'ระบบสารสนเทศ', 'อ. นก', '', '0956981478', '0956981478', 'ผมเอง', '0861890762', '0899992340', '0861890762', ' เซียะเหวิน', 'พ่อ', '[email protected]', 'facebook', '188/177', '351/18', 'A', 'ไม่มี', '', '', 'ไม่มี', '', 'USER');
INSERT INTO `members` VALUES ('ssssss', 'aaaaaa', 'add_button_1-128.png', 'นาย', 'สกาดหกด', 'หกดหกด', 'ddsfsdfd', 'sdfsdf', '1990-12-01', 11, '1231231231231', '11', '11', 'dfgsdfg', '-', '-', '-', '-', '-', '-', 'บิดาถึงแก่กรรม', '5401290082', 3, 'ppppp', 'ระบบสารสนเทศ', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', 'O', 'ไม่มี', '', '', 'ไม่มี', '-', 'USER');
-- --------------------------------------------------------
--
-- Table structure for table `room`
--
CREATE TABLE `room` (
`id` int(10) NOT NULL auto_increment,
`room_value` varchar(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=tis620 AUTO_INCREMENT=127 ;
--
-- Dumping data for table `room`
--
INSERT INTO `room` VALUES (1, 'ไม่มีห้องพัก');
INSERT INTO `room` VALUES (2, 'A201');
INSERT INTO `room` VALUES (3, 'A202');
INSERT INTO `room` VALUES (4, 'A203');
INSERT INTO `room` VALUES (5, 'A204');
INSERT INTO `room` VALUES (6, 'A205');
INSERT INTO `room` VALUES (7, 'A206');
INSERT INTO `room` VALUES (8, 'A207');
INSERT INTO `room` VALUES (9, 'A208');
INSERT INTO `room` VALUES (10, 'A209');
INSERT INTO `room` VALUES (11, 'A210');
INSERT INTO `room` VALUES (12, 'A301');
INSERT INTO `room` VALUES (13, 'A302');
INSERT INTO `room` VALUES (14, 'A303');
INSERT INTO `room` VALUES (15, 'A304');
INSERT INTO `room` VALUES (16, 'A305');
INSERT INTO `room` VALUES (17, 'A306');
INSERT INTO `room` VALUES (18, 'A307');
INSERT INTO `room` VALUES (19, 'A308');
INSERT INTO `room` VALUES (20, 'A309');
INSERT INTO `room` VALUES (21, 'A310');
INSERT INTO `room` VALUES (22, 'A401');
INSERT INTO `room` VALUES (23, 'A402');
INSERT INTO `room` VALUES (24, 'A403');
INSERT INTO `room` VALUES (25, 'A404');
INSERT INTO `room` VALUES (26, 'A405');
INSERT INTO `room` VALUES (27, 'A406');
INSERT INTO `room` VALUES (28, 'A407');
INSERT INTO `room` VALUES (29, 'A408');
INSERT INTO `room` VALUES (30, 'A409');
INSERT INTO `room` VALUES (31, 'A410');
INSERT INTO `room` VALUES (32, 'B101');
INSERT INTO `room` VALUES (33, 'B102');
INSERT INTO `room` VALUES (34, 'B103');
INSERT INTO `room` VALUES (35, 'B104');
INSERT INTO `room` VALUES (36, 'B105');
INSERT INTO `room` VALUES (37, 'B106');
INSERT INTO `room` VALUES (38, 'B107');
INSERT INTO `room` VALUES (39, 'B108');
INSERT INTO `room` VALUES (40, 'B109');
INSERT INTO `room` VALUES (41, 'B211');
INSERT INTO `room` VALUES (42, 'B212');
INSERT INTO `room` VALUES (43, 'B213');
INSERT INTO `room` VALUES (44, 'B214');
INSERT INTO `room` VALUES (45, 'B215');
INSERT INTO `room` VALUES (46, 'B216');
INSERT INTO `room` VALUES (47, 'B217');
INSERT INTO `room` VALUES (48, 'B218');
INSERT INTO `room` VALUES (49, 'B219');
INSERT INTO `room` VALUES (50, 'B311');
INSERT INTO `room` VALUES (51, 'B312');
INSERT INTO `room` VALUES (52, 'B313');
INSERT INTO `room` VALUES (53, 'B314');
INSERT INTO `room` VALUES (54, 'B315');
INSERT INTO `room` VALUES (55, 'B316');
INSERT INTO `room` VALUES (56, 'B317');
INSERT INTO `room` VALUES (57, 'B318');
INSERT INTO `room` VALUES (58, 'B319');
INSERT INTO `room` VALUES (59, 'C111');
INSERT INTO `room` VALUES (60, 'C112');
INSERT INTO `room` VALUES (61, 'C113');
INSERT INTO `room` VALUES (62, 'C114');
INSERT INTO `room` VALUES (63, 'C115');
INSERT INTO `room` VALUES (64, 'C220');
INSERT INTO `room` VALUES (65, 'C221');
INSERT INTO `room` VALUES (66, 'C222');
INSERT INTO `room` VALUES (67, 'C223');
INSERT INTO `room` VALUES (68, 'C224');
INSERT INTO `room` VALUES (69, 'C225');
INSERT INTO `room` VALUES (70, 'C226');
INSERT INTO `room` VALUES (71, 'C227');
INSERT INTO `room` VALUES (72, 'C228');
INSERT INTO `room` VALUES (73, 'C229');
INSERT INTO `room` VALUES (74, 'C230');
INSERT INTO `room` VALUES (75, 'C320');
INSERT INTO `room` VALUES (76, 'C321');
INSERT INTO `room` VALUES (77, 'C322');
INSERT INTO `room` VALUES (78, 'C323');
INSERT INTO `room` VALUES (79, 'C324');
INSERT INTO `room` VALUES (80, 'C325');
INSERT INTO `room` VALUES (81, 'C326');
INSERT INTO `room` VALUES (82, 'C327');
INSERT INTO `room` VALUES (83, 'C328');
INSERT INTO `room` VALUES (84, 'C329');
INSERT INTO `room` VALUES (85, 'C330');
INSERT INTO `room` VALUES (86, 'C411');
INSERT INTO `room` VALUES (87, 'C412');
INSERT INTO `room` VALUES (88, 'C413');
INSERT INTO `room` VALUES (89, 'C414');
INSERT INTO `room` VALUES (90, 'C415');
INSERT INTO `room` VALUES (91, 'C416');
INSERT INTO `room` VALUES (92, 'C417');
INSERT INTO `room` VALUES (93, 'C418');
INSERT INTO `room` VALUES (94, 'C419');
INSERT INTO `room` VALUES (95, 'C420');
INSERT INTO `room` VALUES (96, 'C421');
INSERT INTO `room` VALUES (97, 'D116');
INSERT INTO `room` VALUES (98, 'D117');
INSERT INTO `room` VALUES (99, 'D118');
INSERT INTO `room` VALUES (100, 'D119');
INSERT INTO `room` VALUES (101, 'D120');
INSERT INTO `room` VALUES (102, 'D121');
INSERT INTO `room` VALUES (103, 'D122');
INSERT INTO `room` VALUES (104, 'D123');
INSERT INTO `room` VALUES (105, 'D124');
INSERT INTO `room` VALUES (106, 'D125');
INSERT INTO `room` VALUES (107, 'D231');
INSERT INTO `room` VALUES (108, 'D232');
INSERT INTO `room` VALUES (109, 'D233');
INSERT INTO `room` VALUES (110, 'D234');
INSERT INTO `room` VALUES (111, 'D235');
INSERT INTO `room` VALUES (112, 'D236');
INSERT INTO `room` VALUES (113, 'D237');
INSERT INTO `room` VALUES (114, 'D238');
INSERT INTO `room` VALUES (115, 'D239');
INSERT INTO `room` VALUES (116, 'D240');
INSERT INTO `room` VALUES (117, 'D331');
INSERT INTO `room` VALUES (118, 'D332');
INSERT INTO `room` VALUES (119, 'D333');
INSERT INTO `room` VALUES (120, 'D334');
INSERT INTO `room` VALUES (121, 'D335');
INSERT INTO `room` VALUES (122, 'D336');
INSERT INTO `room` VALUES (123, 'D337');
INSERT INTO `room` VALUES (124, 'D338');
INSERT INTO `room` VALUES (125, 'D339');
INSERT INTO `room` VALUES (126, 'D340');
-- --------------------------------------------------------
--
-- Table structure for table `room_sys`
--
CREATE TABLE `room_sys` (
`member_id` varchar(10) NOT NULL,
`room_id` int(10) default NULL,
PRIMARY KEY (`member_id`)
) ENGINE=MyISAM DEFAULT CHARSET=tis620;
--
-- Dumping data for table `room_sys`
--
INSERT INTO `room_sys` VALUES ('546456456', 2);
INSERT INTO `room_sys` VALUES ('456221', 3);
INSERT INTO `room_sys` VALUES ('234567', 3);
INSERT INTO `room_sys` VALUES ('111', 4);
INSERT INTO `room_sys` VALUES ('424', 2);
INSERT INTO `room_sys` VALUES ('12354', 2);
|
|
|
|
|
Date :
2015-03-30 17:06:54 |
By :
bdown |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|