我需要一个查询来获取'不同用户的数量'在一天访问网址。这是我桌子的结构
我试试这个查询
oload.cpp: In function ‘int main()’:
oload.cpp:30:29: error: call of overloaded ‘value(<brace-enclosed initializer list>)’ is ambiguous
value v({b_utf8("test")});
^
oload.cpp:25:14: note: candidate: value::value(b_symbol)
explicit value(b_symbol) {}
^~~~~
oload.cpp:24:14: note: candidate: value::value(b_utf8)
explicit value(b_utf8) {}
^~~~~
oload.cpp:23:8: note: candidate: constexpr value::value(const value&)
struct value {
^~~~~
oload.cpp:23:8: note: candidate: constexpr value::value(value&&)
但它不起作用。请帮我纠正这个问题。
答案 0 :(得分:1)
使用删除和统计
<?php
header('Access-Control-Allow-Origin: *');
$con=mysqli_connect("localhost","root","?l:@CoLo2016//?[$^*@!(><)my~~~server~~2000]1620","test") or die("error in server");
$sql="SELECT * FROM test";
$qry=mysqli_query($con,$sql) or die(mysqli_error($con));
while($row=mysqli_fetch_row($qry)){
$table_data[]= array("First Name"=$row['fname'],"Last Name"=$row['lname']);
}
echo json_encode($table_data);
?>
答案 1 :(得分:0)
为了让特定日期访问特定链接的用户总数,您需要按网址分组。日期。
SELECT
Count(userid) as usercount ,url, FROM_UNIXTIME(time,'%Y-%m-%d') as date
FROM
mdl_log
GROUP BY date,userid