Add ActiveState for Writing DB table

This commit is contained in:
2019-09-08 18:02:14 +09:00
parent 2c72973476
commit 0c145523ea
2 changed files with 12 additions and 10 deletions
+3 -2
View File
@@ -16,7 +16,8 @@ class WritingCollection extends DBMethodContainer
$query = " $query = "
SELECT WritingID, Name, Filename, LetterCount SELECT WritingID, Name, Filename, LetterCount
FROM writing FROM writing
WHERE Language=?"; WHERE Language=? AND ActivateStatus=1
ORDER BY LetterCount";
$stmt = $this->mysqli->prepare($query); $stmt = $this->mysqli->prepare($query);
$stmt->bind_param("s", $language); $stmt->bind_param("s", $language);
$stmt->execute(); $stmt->execute();
@@ -43,7 +44,7 @@ class WritingCollection extends DBMethodContainer
$query = " $query = "
SELECT WritingID SELECT WritingID
FROM writing FROM writing
WHERE Language=?"; WHERE Language=? AND ActivateStatus=1";
$stmt = $this->mysqli->prepare($query); $stmt = $this->mysqli->prepare($query);
$stmt->bind_param("s", $language); $stmt->bind_param("s", $language);
$stmt->execute(); $stmt->execute();
+9 -8
View File
@@ -129,6 +129,7 @@ INSERT INTO `ads_client` (`AdsClientID`, `ClientName`) VALUES
CREATE TABLE writing ( CREATE TABLE writing (
WritingID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, WritingID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
ActivateStatus INT UNSIGNED NOT NULL,
Language CHAR(10) NOT NULL, Language CHAR(10) NOT NULL,
Name CHAR(50) NOT NULL, Name CHAR(50) NOT NULL,
Filename CHAR(50) NOT NULL, Filename CHAR(50) NOT NULL,
@@ -138,14 +139,14 @@ CREATE TABLE writing (
LetterCount INT UNSIGNED NOT NULL LetterCount INT UNSIGNED NOT NULL
); );
INSERT INTO `writing` (`WritingID`, `Language`, `Name`, `Filename`, `Writer`, `WriterID`, `UpdateDate`, `LetterCount`) VALUES INSERT INTO `writing` (`WritingID`, `Language`, `Name`, `Filename`, `Writer`, `WriterID`, `UpdateDate`, `LetterCount`) VALUES
(1, 'korean', '봄2', 'korean_spring.txt', 'system', NULL, '2019-07-04 00:00:00', 93), (1, 'korean', 1, '봄2', 'korean_spring.txt', 'system', NULL, '2019-07-04 00:00:00', 93),
(2, 'korean', '애국가', 'korean_national_anthem.txt', 'system', NULL, '2019-07-04 00:00:00', 208), (2, 'korean', 1, '애국가', 'korean_national_anthem.txt', 'system', NULL, '2019-07-04 00:00:00', 208),
(3, 'korean', '냉면', 'korean_cold_noodle.txt', 'system', NULL, '2019-07-04 00:00:00', 2101), (3, 'korean', 1, '냉면', 'korean_cold_noodle.txt', 'system', NULL, '2019-07-04 00:00:00', 2101),
(4, 'korean', '허생전', 'korean_heoseng.txt', 'system', NULL, '2019-07-04 00:00:00', 8839), (4, 'korean', 1, '허생전', 'korean_heoseng.txt', 'system', NULL, '2019-07-04 00:00:00', 8839),
(5, 'english', 'Time is', 'english_time_is.txt', 'system', NULL, '2019-07-11 00:00:00', 186), (5, 'english', 1, 'Time is', 'english_time_is.txt', 'system', NULL, '2019-07-11 00:00:00', 186),
(6, 'english', 'Beautiful dreamer', 'english_beautiful_dreamer.txt', 'system', NULL, '2019-07-11 00:00:00', 729), (6, 'english', 1, 'Beautiful dreamer', 'english_beautiful_dreamer.txt', 'system', NULL, '2019-07-11 00:00:00', 729),
(7, 'english', 'The wolf and the seven little kids', 'english_wolf_7kids.txt', 'system', NULL, '2019-07-11 00:00:00', 5765), (7, 'english', 1, 'The wolf and the seven little kids', 'english_wolf_7kids.txt', 'system', NULL, '2019-07-11 00:00:00', 5765),
(8, 'english', 'The happy prince', 'english_happy_prince.txt', 'system', NULL, '2019-07-11 00:00:00', 18355); (8, 'english', 1, 'The happy prince', 'english_happy_prince.txt', 'system', NULL, '2019-07-11 00:00:00', 18355);
CREATE TABLE typing_exam_record ( CREATE TABLE typing_exam_record (