| Server IP : 172.67.187.206 / Your IP : 172.71.28.155 Web Server : Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30 System : Windows NT WIN-ECQAAA40806 6.2 build 9200 (Windows Server 2012 Standard Edition) i586 User : SYSTEM ( 0) PHP Version : 5.6.30 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /dataDB/BackupDB/ |
Upload File : |
-- phpMyAdmin SQL Dump
-- version 4.6.6
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jun 20, 2025 at 03:00 PM
-- Server version: 5.7.17-log
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
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: `exam_db_backup`
--
CREATE DATABASE IF NOT EXISTS `exam_db_backup` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `exam_db_backup`;
-- --------------------------------------------------------
--
-- Table structure for table `answers`
--
CREATE TABLE IF NOT EXISTS `answers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`question_id` int(11) NOT NULL,
`student_id` int(11) NOT NULL,
`choice_id` int(11) DEFAULT NULL,
`descriptive_answer` text,
`descriptive_score` int(11) DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `question_id` (`question_id`),
KEY `student_id` (`student_id`),
KEY `choice_id` (`choice_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
--
-- Dumping data for table `answers`
--
INSERT INTO `answers` (`id`, `question_id`, `student_id`, `choice_id`, `descriptive_answer`, `descriptive_score`, `created_at`) VALUES
(1, 1, 3, 1, NULL, NULL, '2025-05-15 04:17:54'),
(2, 2, 3, NULL, 'uploads/answers/answer_3_2_1747282674.txt', 5, '2025-05-15 04:17:54'),
(3, 3, 3, NULL, 'uploads/answers/answer_3_3_1747293420.txt', 7, '2025-05-15 07:17:00');
-- --------------------------------------------------------
--
-- Table structure for table `choices`
--
CREATE TABLE IF NOT EXISTS `choices` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`question_id` int(11) NOT NULL,
`choice_text` text,
`choice_image` varchar(255) DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `question_id` (`question_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
--
-- Dumping data for table `choices`
--
INSERT INTO `choices` (`id`, `question_id`, `choice_text`, `choice_image`, `created_at`) VALUES
(1, 1, 'ตัวเลือกที่ 1', '', '2025-05-15 03:54:47'),
(2, 1, 'ตัวเลือกที่ 2', '', '2025-05-15 03:54:47'),
(3, 1, 'ตัวเลือกที่ 3', '', '2025-05-15 03:54:47');
-- --------------------------------------------------------
--
-- Table structure for table `exams`
--
CREATE TABLE IF NOT EXISTS `exams` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`teacher_id` int(11) NOT NULL,
`title` varchar(255) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `teacher_id` (`teacher_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
--
-- Dumping data for table `exams`
--
INSERT INTO `exams` (`id`, `teacher_id`, `title`, `created_at`) VALUES
(1, 2, 'คณิตศาสตร์', '2025-05-15 03:45:36'),
(2, 2, 'ภาษาไทย', '2025-05-15 07:15:32');
-- --------------------------------------------------------
--
-- Table structure for table `questions`
--
CREATE TABLE IF NOT EXISTS `questions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`exam_id` int(11) NOT NULL,
`question_text` text,
`question_image` varchar(255) DEFAULT NULL,
`question_type` enum('multiple_choice','descriptive') NOT NULL,
`points` int(11) NOT NULL,
`correct_choice_id` int(11) DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `exam_id` (`exam_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
--
-- Dumping data for table `questions`
--
INSERT INTO `questions` (`id`, `exam_id`, `question_text`, `question_image`, `question_type`, `points`, `correct_choice_id`, `created_at`) VALUES
(1, 1, 'ข้อที่ 1', '', 'multiple_choice', 1, 1, '2025-05-15 03:54:47'),
(2, 1, 'ข้อที่ 2', '', 'descriptive', 10, NULL, '2025-05-15 04:00:37'),
(3, 2, 'ไก่กับไข่อะไรเกิดก่อน', '', 'descriptive', 10, NULL, '2025-05-15 07:16:17'),
(4, 2, '', '../uploads/S__8454197.jpg', 'descriptive', 10, NULL, '2025-05-15 07:27:35');
-- --------------------------------------------------------
--
-- Table structure for table `school`
--
CREATE TABLE IF NOT EXISTS `school` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`s_name` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8;
--
-- Dumping data for table `school`
--
INSERT INTO `school` (`id`, `s_name`) VALUES
(2, 'สวนผึ้งวิทยา'),
(3, 'ปากท่อพิทยาคม'),
(4, 'เบญจมราชูทิศ ราชบุรี'),
(5, 'คุรุราษฎร์รังสฤษฏ์'),
(6, 'ด่านทับตะโกราษฎร์อุปถัมภ์'),
(7, 'วัดสันติการามวิทยา ในพระบรมราชานุเคราะห์'),
(8, 'ราชโบริกานุเคราะห์'),
(9, 'แคทรายวิทยา'),
(10, 'บรมราชินีนาถราชวิทยาลัย'),
(11, 'รัฐราษฎร์อุปถัมภ์'),
(12, 'โสภณศิริราษฎร์'),
(13, 'บ้านคาวิทยา'),
(14, 'สายธรรมจันทร์'),
(15, 'โพธาวัฒนาเสนี'),
(16, 'ประสาทรัฐประชากิจ'),
(17, 'หนองปลาหมอพิทยาคม'),
(18, 'โพหัก (วงศ์สมบูรณ์ราษฎร์อุปถัมภ์)'),
(19, 'หนองโพวิทยา'),
(20, 'เตรียมอุดมศึกษาพัฒนาการ ราชบุรี'),
(21, 'ช่องพรานวิทยา'),
(22, 'เนกขัมวิทยา'),
(23, 'มัธยมวัดดอนตูม'),
(24, 'ท่ามะขามวิทยา'),
(25, 'บางแพปฐมพิทยา'),
(26, 'กรับใหญ่ว่องกุศลกิจพิทยาคม'),
(27, 'รัตนราษฎร์บำรุง');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(50) NOT NULL,
`password` varchar(255) NOT NULL,
`role` enum('admin','teacher','student') NOT NULL,
`name` varchar(100) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`school_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`),
KEY `users_ibfk_1` (`school_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `username`, `password`, `role`, `name`, `created_at`, `school_id`) VALUES
(1, 'admin', 'admin', 'admin', 'admin', '2025-05-15 03:38:05', NULL),
(2, 'teacher1', '123456', 'teacher', 'ครูทดสอบ', '2025-05-15 03:43:35', 2),
(3, '12345', '12345', 'student', 'เด็กชายชยากร ราชนิธยากร', '2025-05-15 04:17:10', 2);
--
-- Constraints for dumped tables
--
--
-- Constraints for table `answers`
--
ALTER TABLE `answers`
ADD CONSTRAINT `answers_ibfk_1` FOREIGN KEY (`question_id`) REFERENCES `questions` (`id`),
ADD CONSTRAINT `answers_ibfk_2` FOREIGN KEY (`student_id`) REFERENCES `users` (`id`),
ADD CONSTRAINT `answers_ibfk_3` FOREIGN KEY (`choice_id`) REFERENCES `choices` (`id`);
--
-- Constraints for table `choices`
--
ALTER TABLE `choices`
ADD CONSTRAINT `choices_ibfk_1` FOREIGN KEY (`question_id`) REFERENCES `questions` (`id`);
--
-- Constraints for table `exams`
--
ALTER TABLE `exams`
ADD CONSTRAINT `exams_ibfk_1` FOREIGN KEY (`teacher_id`) REFERENCES `users` (`id`);
--
-- Constraints for table `questions`
--
ALTER TABLE `questions`
ADD CONSTRAINT `questions_ibfk_1` FOREIGN KEY (`exam_id`) REFERENCES `exams` (`id`);
--
-- Constraints for table `users`
--
ALTER TABLE `users`
ADD CONSTRAINT `users_ibfk_1` FOREIGN KEY (`school_id`) REFERENCES `school` (`id`);
/*!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 */;