質問編集履歴

1

コードの表記を変更しました。

2018/04/26 13:13

投稿

ouranosu
ouranosu

スコア6

test CHANGED
File without changes
test CHANGED
@@ -4,27 +4,49 @@
4
4
 
5
5
 
6
6
 
7
- データベースからデータ取り込み
7
+ データベースからデータ取り込み(userclass.php)
8
+
9
+ ```PHP
8
10
 
9
11
  while($stmt->FETCH()){
10
12
 
11
- $row = array(
13
+ $row = array(
12
14
 
13
-       'メモ'=>$メモ,
15
+ 'id'=>$id,
14
16
 
15
- '前回来店日'=>$前回来店日,
17
+ 'username_kanji'=>$username_kanji,
16
18
 
17
-        'comment'=>$row["comment"].$前回来店時.$メモ
19
+ 'username_kana'=>$username_kana,
18
20
 
19
- );
21
+ 'tel'=>$tel,
20
22
 
23
+ 'birthday'=>substr($birthday,0,4).("年").substr($birthday,4,-2).("月").substr($birthday,-2).("日"),
24
+
25
+ 'last_day'=>$last_day,
26
+
27
+ 'comment'=>$row["comment"].$comlast_day.$comment.PHP_EOL
28
+
29
+ );
30
+
21
- $_SESSION['userdata'] = $row;
31
+ $_SESSION['userdata'] = $row;
32
+
33
+ }
34
+
35
+ ```
22
36
 
23
37
 
24
38
 
39
+
40
+
25
- 表示
41
+ 表示(select.php)
42
+
43
+ ```PHP
26
44
 
27
45
  <?php echo htmlentities($_SESSION['userdata']['comment']) ?>
46
+
47
+ ```
48
+
49
+
28
50
 
29
51
 
30
52
 
@@ -42,6 +64,16 @@
42
64
 
43
65
 
44
66
 
45
- うまく伝られずすみせん
67
+ ご指摘いただいてコードの書き方を変えました
46
68
 
69
+ 問題はcomment部分で
70
+
71
+ ```PHP
72
+
73
+ 'comment'=>$row["comment"].$comlast_day.$comment.PHP_EOL
74
+
75
+ ```
76
+
77
+ これで過去のメモを結合させて一気に表示させようとしたのですが、改行ができないことです。
78
+
47
- 色々調べのですがどうにもならないのでどなたか教授ますか?
79
+ んちんかんなことをしいるかもれないのですが、改めて指摘おいします