Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/236.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何列出每个活动的注册者总数和具体细节_Php_Html_Mysql_Mysqli - Fatal编程技术网

Php 如何列出每个活动的注册者总数和具体细节

Php 如何列出每个活动的注册者总数和具体细节,php,html,mysql,mysqli,Php,Html,Mysql,Mysqli,下面显示的是他们各自的表格,我想知道我们如何获得每个活动的注册者的总人数和具体细节 ?>使用连接和计数。你的问题质量很差,这是瞎猜 SELECT Events.*, COUNT(DISTINCT Registrants.regID) AS registrantCount FROM t_events AS Events LEFT JOIN t_attendant AS Registrants ON (Registrants.eventID = Events.even

下面显示的是他们各自的表格,我想知道我们如何获得每个活动的注册者的总人数和具体细节

?>

使用连接和计数。你的问题质量很差,这是瞎猜

SELECT 
    Events.*,
    COUNT(DISTINCT Registrants.regID) AS registrantCount
FROM t_events AS Events 
LEFT JOIN t_attendant AS Registrants 
    ON (Registrants.eventID = Events.eventID)
GROUP BY 
    Events.id

你能发布你到目前为止尝试过的吗?使用选择计数不要使用图像。堆栈允许您发布代码,您知道并且
SELECT 
    Events.*,
    COUNT(DISTINCT Registrants.regID) AS registrantCount
FROM t_events AS Events 
LEFT JOIN t_attendant AS Registrants 
    ON (Registrants.eventID = Events.eventID)
GROUP BY 
    Events.id