teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

4

追記しました。

2020/04/03 07:37

投稿

cacao86
cacao86

スコア97

title CHANGED
File without changes
body CHANGED
@@ -21,7 +21,8 @@
21
21
  お願い致します!
22
22
 
23
23
  ### 追記
24
- テーブル定義です。テーブルは1つだけです。
24
+ テーブル定義です。テーブルは1つだけです。親と子だけなので2階層になります。
25
+ ```ここに言語を入力
25
26
  | t_bbs | CREATE TABLE `t_bbs` (
26
27
  `id` int(11) NOT NULL AUTO_INCREMENT,
27
28
  `name` varchar(255) DEFAULT NULL,
@@ -33,4 +34,12 @@
33
34
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
34
35
  `deleted_at` datetime DEFAULT NULL,
35
36
  KEY `id` (`id`)
36
- ) ENGINE=InnoDB AUTO_INCREMENT=1590 DEFAULT CHARSET=utf8 |
37
+ ) ENGINE=InnoDB AUTO_INCREMENT=1590 DEFAULT CHARSET=utf8 |
38
+ ```
39
+ ```
40
+ +-----------------+
41
+ | version() |
42
+ +-----------------+
43
+ | 10.4.12-MariaDB |
44
+ +-----------------+
45
+ ```

3

追記しました。

2020/04/03 07:37

投稿

cacao86
cacao86

スコア97

title CHANGED
File without changes
body CHANGED
@@ -22,16 +22,15 @@
22
22
 
23
23
  ### 追記
24
24
  テーブル定義です。テーブルは1つだけです。
25
- +------------+--------------+-----------------+------+-----+---------------------+-------------------------------+---------------------------------+---------+
26
- | Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment |
25
+ | t_bbs | CREATE TABLE `t_bbs` (
27
- +------------+--------------+-----------------+------+-----+---------------------+-------------------------------+---------------------------------+---------+
28
- | id | int(11) | NULL | NO | MUL | NULL | auto_increment | select,insert,update,references | |
26
+ `id` int(11) NOT NULL AUTO_INCREMENT,
29
- | name | varchar(255) | utf8_general_ci | YES | | NULL | | select,insert,update,references | |
27
+ `name` varchar(255) DEFAULT NULL,
30
- | subject | varchar(255) | utf8_general_ci | YES | | NULL | | select,insert,update,references | |
28
+ `subject` varchar(255) DEFAULT NULL,
31
- | body | text | utf8_general_ci | YES | | NULL | | select,insert,update,references | |
29
+ `body` text DEFAULT NULL,
32
- | parent_id | int(11) | NULL | YES | | NULL | | select,insert,update,references | |
30
+ `parent_id` int(11) DEFAULT NULL,
33
- | post_user | varchar(8) | utf8_general_ci | YES | | NULL | | select,insert,update,references | |
31
+ `post_user` varchar(8) DEFAULT NULL,
34
- | created_at | datetime | NULL | NO | | current_timestamp() | | select,insert,update,references | |
32
+ `created_at` datetime NOT NULL DEFAULT current_timestamp(),
35
- | updated_at | datetime | NULL | NO | | current_timestamp() | on update current_timestamp() | select,insert,update,references | |
33
+ `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
34
+ `deleted_at` datetime DEFAULT NULL,
35
+ KEY `id` (`id`)
36
- | deleted_at | datetime | NULL | YES | | NULL | | select,insert,update,references | |
36
+ ) ENGINE=InnoDB AUTO_INCREMENT=1590 DEFAULT CHARSET=utf8 |
37
- +------------+--------------+-----------------+------+-----+---------------------+-------------------------------+---------------------------------+---------+

2

追記しました。

2020/04/03 07:01

投稿

cacao86
cacao86

スコア97

title CHANGED
File without changes
body CHANGED
@@ -21,7 +21,7 @@
21
21
  お願い致します!
22
22
 
23
23
  ### 追記
24
- テーブル定義です
24
+ テーブル定義です。テーブルは1つだけです。
25
25
  +------------+--------------+-----------------+------+-----+---------------------+-------------------------------+---------------------------------+---------+
26
26
  | Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment |
27
27
  +------------+--------------+-----------------+------+-----+---------------------+-------------------------------+---------------------------------+---------+

1

追記しました。

2020/04/03 06:44

投稿

cacao86
cacao86

スコア97

title CHANGED
File without changes
body CHANGED
@@ -18,4 +18,20 @@
18
18
  現状ですと最初だけ親子だけを取り出すのですが以降はずっと親だけ取り出してしまいます。
19
19
 
20
20
  お力添えいただきたく思います!
21
- お願い致します!
21
+ お願い致します!
22
+
23
+ ### 追記
24
+ テーブル定義です
25
+ +------------+--------------+-----------------+------+-----+---------------------+-------------------------------+---------------------------------+---------+
26
+ | Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment |
27
+ +------------+--------------+-----------------+------+-----+---------------------+-------------------------------+---------------------------------+---------+
28
+ | id | int(11) | NULL | NO | MUL | NULL | auto_increment | select,insert,update,references | |
29
+ | name | varchar(255) | utf8_general_ci | YES | | NULL | | select,insert,update,references | |
30
+ | subject | varchar(255) | utf8_general_ci | YES | | NULL | | select,insert,update,references | |
31
+ | body | text | utf8_general_ci | YES | | NULL | | select,insert,update,references | |
32
+ | parent_id | int(11) | NULL | YES | | NULL | | select,insert,update,references | |
33
+ | post_user | varchar(8) | utf8_general_ci | YES | | NULL | | select,insert,update,references | |
34
+ | created_at | datetime | NULL | NO | | current_timestamp() | | select,insert,update,references | |
35
+ | updated_at | datetime | NULL | NO | | current_timestamp() | on update current_timestamp() | select,insert,update,references | |
36
+ | deleted_at | datetime | NULL | YES | | NULL | | select,insert,update,references | |
37
+ +------------+--------------+-----------------+------+-----+---------------------+-------------------------------+---------------------------------+---------+