質問編集履歴
3
題名と質問の内容が違うということで変更しました。
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
データ
|
1
|
+
SELECT文でデータの値を取得したいが、うまくcountできない
|
body
CHANGED
@@ -1,22 +1,12 @@
|
|
1
|
-
よろしくお願いいたします。
|
2
1
|
**前提・実現したいこと**
|
3
|
-
wordpressのプラグイン
|
4
|
-
①「一日毎のPV数を取得したい」
|
5
|
-

|
6
|
-
ファイル名:wp-slimstat-reports.php(1231行目)**今日のpv数を表示しているコード**
|
7
|
-
<p><?php _e('Today', 'wp-slimstat'); ?> <span><?php echo number_format(wp_slimstat_db::count_records('id', 'dt > '.(date_i18n('U', mktime(0, 0, 0, date_i18n('m'), date_i18n('d'), date_i18n('Y')))), false), 0, '', wp_slimstat_db::$formats['thousand']) ?></span></p>
|
2
|
+
wordpressのプラグインslimstatのPV数を1日ごとに取得したい
|
8
3
|
|
4
|
+
**発生している問題**
|
9
5
|
|
10
|
-
②S「一日毎の訪問数を取得したい」
|
11
|
-

|
12
|
-
|
6
|
+
5/4と5/5のPV数を合計して一行で表示したい
|
13
|
-
<?php _e( 'Visits', 'wp-slimstat' ) ?> <span><?php echo number_format( $total_human_visits, 0, '', wp_slimstat_db::$formats['thousand'] ) ?></span></p>
|
14
7
|
|
15
|
-
|
16
|
-
|
8
|
+
select select date_format(from_unixtime(dt),'%Y-%m-%d') as '日付', count(id) as 'PV数'
|
9
|
+
from wp.wp_slim_stats
|
10
|
+
group by dt;
|
17
11
|
|
18
|
-
**発生している問題**
|
19
|
-
SELECT文でデータの値を取得したいが、うまくcountできない
|
20
|
-
|
12
|
+

|
21
|
-
from(select date_format(from_unixtime(dt),'%Y-%m-%d') as '日付', id, dt from wp_soumu.wp_slim_stats) b
|
22
|
-
group by b.日付
|
2
SELECT文追加しました
title
CHANGED
File without changes
|
body
CHANGED
@@ -16,4 +16,7 @@
|
|
16
16
|
カラム:id,ip,other_ip,username,country,referer,resorce,searchterms,plugins,notes,visit_id,server_latency,page_performance,browser,browser_type,platform,langage,use_agent,resolution,screen_with,screen_height,content_type,category,author,content_id,outbound_resouce,dt
|
17
17
|
|
18
18
|
**発生している問題**
|
19
|
-
SELECT文でデータの値を取得したいが、うまくcountできない
|
19
|
+
SELECT文でデータの値を取得したいが、うまくcountできない
|
20
|
+
select b.日付, count(b.id) as 'PV数'
|
21
|
+
from(select date_format(from_unixtime(dt),'%Y-%m-%d') as '日付', id, dt from wp_soumu.wp_slim_stats) b
|
22
|
+
group by b.日付
|
1
すみません。発生している問題をついかしました。
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
データベースから値を取得してcsvに書き出す
|
1
|
+
データベースから値を取得してcsvファイルに書き出す
|
body
CHANGED
@@ -1,15 +1,19 @@
|
|
1
1
|
よろしくお願いいたします。
|
2
|
+
**前提・実現したいこと**
|
2
|
-
wordpressのプラグイン「slimstat」のPV数と訪問数を日毎に取得しcsvに書き出したい
|
3
|
+
wordpressのプラグイン「slimstat」のPV数と訪問数を1日毎に取得しcsvに書き出したい
|
3
4
|
①「一日毎のPV数を取得したい」
|
4
5
|

|
5
|
-
ファイル名:wp-slimstat-reports.php(1231行目)**今日のpv数表示**
|
6
|
+
ファイル名:wp-slimstat-reports.php(1231行目)**今日のpv数を表示しているコード**
|
6
7
|
<p><?php _e('Today', 'wp-slimstat'); ?> <span><?php echo number_format(wp_slimstat_db::count_records('id', 'dt > '.(date_i18n('U', mktime(0, 0, 0, date_i18n('m'), date_i18n('d'), date_i18n('Y')))), false), 0, '', wp_slimstat_db::$formats['thousand']) ?></span></p>
|
7
8
|
|
8
9
|
|
9
10
|
②S「一日毎の訪問数を取得したい」
|
10
11
|

|
11
|
-
ファイル名:wp-slimstat-reports.php(1264行目)**訪問数表示**
|
12
|
+
ファイル名:wp-slimstat-reports.php(1264行目)**訪問数表示しているコード**
|
12
13
|
<?php _e( 'Visits', 'wp-slimstat' ) ?> <span><?php echo number_format( $total_human_visits, 0, '', wp_slimstat_db::$formats['thousand'] ) ?></span></p>
|
13
14
|
|
14
15
|
テーブル:wp_slim_stats
|
15
|
-
カラム:id,ip,other_ip,username,country,referer,resorce,searchterms,plugins,notes,visit_id,server_latency,page_performance,browser,browser_type,platform,langage,use_agent,resolution,screen_with,screen_height,content_type,category,author,content_id,outbound_resouce,dt
|
16
|
+
カラム:id,ip,other_ip,username,country,referer,resorce,searchterms,plugins,notes,visit_id,server_latency,page_performance,browser,browser_type,platform,langage,use_agent,resolution,screen_with,screen_height,content_type,category,author,content_id,outbound_resouce,dt
|
17
|
+
|
18
|
+
**発生している問題**
|
19
|
+
SELECT文でデータの値を取得したいが、うまくcountできない
|