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

質問編集履歴

1

php部分追記。

2019/05/21 04:32

投稿

awazon78
awazon78

スコア32

title CHANGED
File without changes
body CHANGED
@@ -28,6 +28,7 @@
28
28
  ```
29
29
  このような感じで、配列で取り出せれば理想です。
30
30
 
31
+
31
32
  # 現在の環境
32
33
 
33
34
  テーブルは以下の様な感じです。
@@ -71,4 +72,24 @@
71
72
  HAVING `max_date` <= (UNIX_TIMESTAMP() - 15552000)
72
73
  ```
73
74
 
74
- 以上になります。ご教授宜しくお願いします!
75
+ 以上になります。ご教授宜しくお願いします!
76
+
77
+
78
+ 2019/05/21 13:30 追記
79
+ --------------------------------------
80
+ 配列の時点でメモリーエラーでは?とご意見いただきましたので、SQL文を発行している箇所を追記します。
81
+ ```php
82
+ $this->db = $this->load->database('db_slave', true);
83
+
84
+ $this->db->select('user_id,MAX(date) as max_date')->from('point_history_copy');
85
+ $this->db->where("expire_date <=", 0);
86
+ $this->db->group_by('user_id');
87
+ $this->db->having('max_date <= (' . $this->time . ' - 15552000)');
88
+ $array = $this->db->get()->result_array();
89
+
90
+ return $array;
91
+ //↑returnされる前にメモリーが足りなくてエラーが出ます。
92
+ ```
93
+
94
+ そして現在
95
+ php.iniのmemory_limmitは256MBでした。