質問編集履歴
3
大きな変更点はありません。
title
CHANGED
File without changes
|
body
CHANGED
@@ -116,7 +116,7 @@
|
|
116
116
|
|
117
117
|
・PHP Version 5.5.24
|
118
118
|
・Client API version
|
119
|
-
→mysqlnd 5.0.11
|
119
|
+
→mysqlnd 5.0.11
|
120
120
|
|
121
121
|
・使用しているのは、Eclipse_4.7.1
|
122
122
|
phpmyadminには、親カテゴリーtable、子カテゴリーtable、コンテンツtableがあります。
|
2
phpinfo()の、PHP VersionとMysqlのClient API Versionを追記しました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -111,5 +111,12 @@
|
|
111
111
|
|
112
112
|
###補足情報(言語/FW/ツール等のバージョンなど)
|
113
113
|
・Codeigniter3.2.0
|
114
|
+
|
115
|
+
phpinfoを表示したところ、下記となりました。
|
116
|
+
|
117
|
+
・PHP Version 5.5.24
|
118
|
+
・Client API version
|
119
|
+
→mysqlnd 5.0.11-dev - 20120503 - $Id: 15d5c781cfcad91193dceae1d2cdd127674ddb3e $
|
120
|
+
|
114
|
-
使用しているのは、Eclipse_4.7.1
|
121
|
+
・使用しているのは、Eclipse_4.7.1
|
115
122
|
phpmyadminには、親カテゴリーtable、子カテゴリーtable、コンテンツtableがあります。
|
1
コンテンツ_modelの内容を追加しました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -41,6 +41,39 @@
|
|
41
41
|
|
42
42
|
==========================================
|
43
43
|
|
44
|
+
【コンテンツ_model.php】
|
45
|
+
|
46
|
+
<?php
|
47
|
+
|
48
|
+
class コンテンツ_model extends CI_Model
|
49
|
+
{
|
50
|
+
public function __construct()
|
51
|
+
{
|
52
|
+
parent::__construct();
|
53
|
+
$this->load->database();
|
54
|
+
}
|
55
|
+
|
56
|
+
public function get_data(){
|
57
|
+
$per_page = 15;
|
58
|
+
$query = $this->db->get('contents', $per_page);
|
59
|
+
|
60
|
+
if ($query->num_rows() > 0){
|
61
|
+
return $query->result_array();
|
62
|
+
}
|
63
|
+
else
|
64
|
+
{
|
65
|
+
return [];
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
69
|
+
public function create($category = null)
|
70
|
+
{
|
71
|
+
$this->db->insert('contents', $data);
|
72
|
+
}
|
73
|
+
}
|
74
|
+
|
75
|
+
==========================================
|
76
|
+
|
44
77
|
【登録用_controller.php】
|
45
78
|
|
46
79
|
defined ('BASEPATH') OR exit('No direct script access allowed');
|
@@ -63,7 +96,7 @@
|
|
63
96
|
$this->r_child_category_model->create($data);
|
64
97
|
|
65
98
|
$data = array('content' => $this->input->post('category'));
|
66
|
-
$this->r_contents_model->create($data);
|
99
|
+
$this->r_contents_model->create($data);
|
67
100
|
}
|
68
101
|
|
69
102
|
$this->load->view('admin/contents_add', $data);
|