質問編集履歴
3
大きな変更点はありません。
test
CHANGED
File without changes
|
test
CHANGED
@@ -234,7 +234,7 @@
|
|
234
234
|
|
235
235
|
・Client API version
|
236
236
|
|
237
|
-
→mysqlnd 5.0.11
|
237
|
+
→mysqlnd 5.0.11
|
238
238
|
|
239
239
|
|
240
240
|
|
2
phpinfo()の、PHP VersionとMysqlのClient API Versionを追記しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -224,6 +224,20 @@
|
|
224
224
|
|
225
225
|
・Codeigniter3.2.0
|
226
226
|
|
227
|
+
|
228
|
+
|
229
|
+
phpinfoを表示したところ、下記となりました。
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
・PHP Version 5.5.24
|
234
|
+
|
235
|
+
・Client API version
|
236
|
+
|
237
|
+
→mysqlnd 5.0.11-dev - 20120503 - $Id: 15d5c781cfcad91193dceae1d2cdd127674ddb3e $
|
238
|
+
|
239
|
+
|
240
|
+
|
227
|
-
使用しているのは、Eclipse_4.7.1
|
241
|
+
・使用しているのは、Eclipse_4.7.1
|
228
242
|
|
229
243
|
phpmyadminには、親カテゴリーtable、子カテゴリーtable、コンテンツtableがあります。
|
1
コンテンツ_modelの内容を追加しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -84,6 +84,72 @@
|
|
84
84
|
|
85
85
|
|
86
86
|
|
87
|
+
【コンテンツ_model.php】
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
<?php
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
class コンテンツ_model extends CI_Model
|
96
|
+
|
97
|
+
{
|
98
|
+
|
99
|
+
public function __construct()
|
100
|
+
|
101
|
+
{
|
102
|
+
|
103
|
+
parent::__construct();
|
104
|
+
|
105
|
+
$this->load->database();
|
106
|
+
|
107
|
+
}
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
public function get_data(){
|
112
|
+
|
113
|
+
$per_page = 15;
|
114
|
+
|
115
|
+
$query = $this->db->get('contents', $per_page);
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
if ($query->num_rows() > 0){
|
120
|
+
|
121
|
+
return $query->result_array();
|
122
|
+
|
123
|
+
}
|
124
|
+
|
125
|
+
else
|
126
|
+
|
127
|
+
{
|
128
|
+
|
129
|
+
return [];
|
130
|
+
|
131
|
+
}
|
132
|
+
|
133
|
+
}
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
public function create($category = null)
|
138
|
+
|
139
|
+
{
|
140
|
+
|
141
|
+
$this->db->insert('contents', $data);
|
142
|
+
|
143
|
+
}
|
144
|
+
|
145
|
+
}
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
==========================================
|
150
|
+
|
151
|
+
|
152
|
+
|
87
153
|
【登録用_controller.php】
|
88
154
|
|
89
155
|
|
@@ -128,7 +194,7 @@
|
|
128
194
|
|
129
195
|
$data = array('content' => $this->input->post('category'));
|
130
196
|
|
131
|
-
$this->r_contents_model->create($data);
|
197
|
+
$this->r_contents_model->create($data);
|
132
198
|
|
133
199
|
}
|
134
200
|
|