質問編集履歴

2

掲示内容のの変更

2019/07/15 12:22

投稿

laph
laph

スコア17

test CHANGED
File without changes
test CHANGED
@@ -10,19 +10,435 @@
10
10
 
11
11
 
12
12
 
13
+ ```エラー文
14
+
15
+ Warning: Use of undefined constant ‘dbset - assumed '‘dbset' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\lchart.php on line 104
16
+
17
+ Warning: Use of undefined constant php’ - assumed 'php’' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\lchart.php on line 104
18
+
19
+
20
+
21
+ Warning: include(‘dbsetphp’): failed to open stream: No such file or directory in C:\xampp\htdocs\lchart.php on line 104
22
+
23
+
24
+
25
+ Warning: include(): Failed opening '‘dbsetphp’' for inclusion (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\lchart.php on line 104
26
+
13
27
  ```
14
28
 
15
- Warning: Use of undefined constant ‘dbset - assumed '‘dbset' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\lchart.php on line 104
16
-
17
- Warning: Use of undefined constant php’ - assumed 'php’' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\lchart.php on line 104
18
-
19
-
20
-
21
- Warning: include(‘dbsetphp’): failed to open stream: No such file or directory in C:\xampp\htdocs\lchart.php on line 104
22
-
23
-
24
-
25
- Warning: include(): Failed opening '‘dbsetphp’' for inclusion (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\lchart.php on line 104
29
+
30
+
31
+
32
+
33
+ ```lchart.php
34
+
35
+ <html lang="ja">
36
+
37
+ <head>
38
+
39
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
40
+
41
+ <meta name="keywords"content="html,css,javascript"/>
42
+
43
+ <script type="text/javascript" src=""></script>
44
+
45
+ <title>rchart</title>
46
+
47
+ </head>
48
+
49
+ <style>
50
+
51
+ body{
52
+
53
+ background-color:#F5F5F5;
54
+
55
+ color : #000000;
56
+
57
+ margin: 0 auto;
58
+
59
+ font-size:62.5%;
60
+
61
+ }
62
+
63
+
64
+
65
+ #header{
66
+
67
+ width:auto;
68
+
69
+ height:30px;
70
+
71
+ background-color:#E9D922;
72
+
73
+ font-size:2.0em;
74
+
75
+ text-align : center;
76
+
77
+ }
78
+
79
+
80
+
81
+ #contents{
82
+
83
+ width:900px;
84
+
85
+ min-height:800px;
86
+
87
+ color : #000000;
88
+
89
+ margin: 0 auto;
90
+
91
+ margin-top:1.5%;
92
+
93
+ margin-bottom: 1.5%;
94
+
95
+ background-color :#ffffff;
96
+
97
+ font-size: 1.6em;
98
+
99
+ line-height: 1.5em;
100
+
101
+ border-radius: 15px;
102
+
103
+ }
104
+
105
+
106
+
107
+ .wrap{
108
+
109
+ text-align:center;
110
+
111
+ }
112
+
113
+
114
+
115
+ #footer{
116
+
117
+ width: auto;
118
+
119
+ height:80px;
120
+
121
+ background-color :red;
122
+
123
+ color : #000;
124
+
125
+ font-size:1.4em;
126
+
127
+ text-align : center;
128
+
129
+ }
130
+
131
+
132
+
133
+ * { box-sizing: border-box }
134
+
135
+ li { list-style-type: none }
136
+
137
+ li:before {
138
+
139
+ content: "";
140
+
141
+ display: inline-block;
142
+
143
+ height: 13px;
144
+
145
+ width: 13px;
146
+
147
+ margin-right: 5px;
148
+
149
+ border-radius: 3px;
150
+
151
+ }
152
+
153
+
154
+
155
+ li.rcyellow:before {
156
+
157
+ background: #f1eb31;
158
+
159
+ }
160
+
161
+ li.rcorenge:before {
162
+
163
+ background: #f4a14a;
164
+
165
+ }
166
+
167
+ li.rcgreen:before {
168
+
169
+ background: #b3dab9;
170
+
171
+ }
172
+
173
+ li.rcblue:before {
174
+
175
+ background: #8BD0DE;
176
+
177
+ }
178
+
179
+ li.rcyelgreen:before {
180
+
181
+ background: #DFE890;
182
+
183
+ }
184
+
185
+ li.rcpink:before {
186
+
187
+ background: #F0A1A1;
188
+
189
+ }
190
+
191
+ li.rcbluegre:before {
192
+
193
+ background: #76A9B5;
194
+
195
+ }
196
+
197
+ li.rcpnevie:before {
198
+
199
+ background: #8798B9;
200
+
201
+ }
202
+
203
+ li.rcgold:before {
204
+
205
+ background: #D5C574;
206
+
207
+ }
208
+
209
+ li.rcrpink:before {
210
+
211
+ background: #EE8081;
212
+
213
+ }
214
+
215
+
216
+
217
+ p {text-align: center}
218
+
219
+
220
+
221
+ .koumokuyoko ul li {
222
+
223
+ display: inline;
224
+
225
+ }
226
+
227
+ </style>
228
+
229
+ <body>
230
+
231
+
232
+
233
+ <div id="header">
234
+
235
+ <img src="lemon_bar.png">
236
+
237
+ </div>
238
+
239
+ <div id="contents">
240
+
241
+ <?php include(‘dbset.php’);?>
242
+
243
+ <BR>
244
+
245
+ <div class="wrap">
246
+
247
+ <canvas id="pie-chart" height="300" width="300"></canvas>
248
+
249
+ </diV>
250
+
251
+ <div class="koumokuyoko">
252
+
253
+ <ul>
254
+
255
+
256
+
257
+ <?php
258
+
259
+ //MySQL DB接続(サーバ名,接続ユーザ名,パスワード,データベース名)
260
+
261
+ $link=mysqli_connect("127.0.0.1","root","admin_1001","lcdb");
262
+
263
+
264
+
265
+ //SQL文を指定
266
+
267
+ $query="SELECT * FROM lcqtbl WHERE KNO=1";
268
+
269
+
270
+
271
+ //PHPからSQL文を実行(接続名 $link に対して $query のSQL文を実行)
272
+
273
+ //結果は$resultに格納される
274
+
275
+ $result=mysqli_query($link,$query);
276
+
277
+
278
+
279
+ //$result から1行取り出して,1項目ごとに配列 $row (フィールド名をキーとした連想配列)に格納
280
+
281
+ $row=mysqli_fetch_assoc($result);
282
+
283
+
284
+
285
+ //$row 配列の中身(選択肢)を表示
286
+
287
+ IF(is_null($row['cho1'])){
288
+
289
+ }else{
290
+
291
+ echo "<li class=rcyellow>".$row['cho1']."&nbsp;&nbsp;</li>";
292
+
293
+ IF(is_null($row['cho2'])){
294
+
295
+ }else{
296
+
297
+ echo "<li class=rcorenge>".$row['cho2']."&nbsp;&nbsp;</li>";
298
+
299
+ IF(is_null($row['cho3'])){
300
+
301
+ }else{
302
+
303
+ echo "<li class=rcgreen>".$row['cho3']."&nbsp;&nbsp;</li>";
304
+
305
+ IF(is_null($row['cho4'])){
306
+
307
+ }else{
308
+
309
+ echo "<li class=rcblue>".$row['cho4']."&nbsp;&nbsp;</li>";
310
+
311
+ IF(is_null($row['cho5'])){
312
+
313
+ }else{
314
+
315
+ echo "<li class=rcyelgreen>".$row['cho5']."&nbsp;&nbsp;</li>";
316
+
317
+ IF(is_null($row['cho6'])){
318
+
319
+ }else{
320
+
321
+ echo "<li class=rcpink>".$row['cho6']."&nbsp;&nbsp;</li>";
322
+
323
+ IF(is_null($row['cho7'])){
324
+
325
+ }else{
326
+
327
+ echo "<li class=rcbluegre>".$row['cho7']."&nbsp;&nbsp;</li>";
328
+
329
+ IF(is_null($row['cho8'])){
330
+
331
+ }else{
332
+
333
+ echo "<li class=rcpnevie>".$row['cho8']."&nbsp;&nbsp;</li>";
334
+
335
+ IF(is_null($row['cho9'])){
336
+
337
+ }else{
338
+
339
+ echo "<li class=rcgold>".$row['cho9']."&nbsp;&nbsp;</li>";
340
+
341
+ IF(is_null($row['cho10'])){
342
+
343
+ }else{
344
+
345
+ echo "<li class=rcrpink>".$row['cho10']."&nbsp;&nbsp;</li>";
346
+
347
+ }
348
+
349
+ }
350
+
351
+ }
352
+
353
+ }
354
+
355
+ }
356
+
357
+ }
358
+
359
+ }
360
+
361
+ }
362
+
363
+ }
364
+
365
+ }
366
+
367
+ ?>
368
+
369
+ </ul>
370
+
371
+ </div>
372
+
373
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js"></script>
374
+
375
+ <!-- もしくは<script src="Chart.js"></script> -->
376
+
377
+ <script>
378
+
379
+ var pieData = [
380
+
381
+ {
382
+
383
+ value: 65,
384
+
385
+ color:"#f1eb31",
386
+
387
+ highlight: "#aadbf2",
388
+
389
+ label: "そう思う"
390
+
391
+ },
392
+
393
+ {
394
+
395
+ value: 35,
396
+
397
+ color: "#f4a14a",
398
+
399
+ highlight: "#aadbf2",
400
+
401
+ label: "そう思わない"
402
+
403
+ },
404
+
405
+ {
406
+
407
+ value: 5,
408
+
409
+ color: "#b3dab9",
410
+
411
+ highlight: "#aadbf2",
412
+
413
+ label: "どちらでも"
414
+
415
+ }
416
+
417
+ ];
418
+
419
+
420
+
421
+ window.onload = function(){
422
+
423
+ var ctx = document.getElementById("pie-chart").getContext("2d");
424
+
425
+ window.myPie = new Chart(ctx).Pie(pieData);
426
+
427
+ };
428
+
429
+
430
+
431
+ </script>
432
+
433
+ </div>
434
+
435
+
436
+
437
+ </body>
438
+
439
+ </html>
440
+
441
+
26
442
 
27
443
  ```
28
444
 
@@ -32,15 +448,9 @@
32
448
 
33
449
 
34
450
 
35
- lchart.php
36
-
37
- <?php include(‘dbset.php’); ?>
38
-
39
-
40
-
41
451
  --------------------------------------------------------
42
452
 
43
- dbset.php
453
+ ```dbset.php
44
454
 
45
455
  <?php
46
456
 
@@ -66,6 +476,10 @@
66
476
 
67
477
  ?>
68
478
 
479
+ ```
480
+
481
+
482
+
69
483
 
70
484
 
71
485
 

1

誤字の変更

2019/07/15 12:22

投稿

laph
laph

スコア17

test CHANGED
File without changes
test CHANGED
@@ -10,15 +10,9 @@
10
10
 
11
11
 
12
12
 
13
- ■機能を実装中に以下のエラーメッセージが発生しました。
13
+ ```
14
-
15
-
16
-
17
-
18
14
 
19
15
  Warning: Use of undefined constant ‘dbset - assumed '‘dbset' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\lchart.php on line 104
20
-
21
-
22
16
 
23
17
  Warning: Use of undefined constant php’ - assumed 'php’' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\lchart.php on line 104
24
18
 
@@ -30,13 +24,15 @@
30
24
 
31
25
  Warning: include(): Failed opening '‘dbsetphp’' for inclusion (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\lchart.php on line 104
32
26
 
27
+ ```
33
28
 
34
29
 
35
30
 
36
31
 
37
- ### 該当のソースコード
38
32
 
33
+
34
+
39
- test.php
35
+ lchart.php
40
36
 
41
37
  <?php include(‘dbset.php’); ?>
42
38