$query1="SELECT count(tbl_data1.id) AS total FROM tbl_data1 INNER JOIN tbl_member AS m
ON (tbl_data1.m_id = m.m_id) INNER JOIN tbl_school as t ON (t.sc_id = m.m_scho) GROUP BY tbl_data1.m_id ";
$result1 = mysqli_query($condb, $query1) or die ("Error in query: $query1 " . mysqli_error());
$row_listadmin = mysqli_fetch_array($result1);
total = แสดงผลออก
echo $row_listadmin['m_firstname'] = ไม่ออก
$query1 = " SELECT count(tbl_data1.id) AS total
FROM tbl_data1
INNER JOIN tbl_member AS m ON (tbl_data1.m_id = m.m_id)
INNER JOIN tbl_school as t ON (t.sc_id = m.m_scho)
GROUP BY tbl_data1.m_id ";
$query1 = " SELECT GROUP_CONCAT(stName SEPARATOR ',') as student_name
, GROUP_CONCAT(sc_name SEPARATOR ',') as school_name
, count(id) AS total
FROM (
SELECT tbl_data1.id
, CONCAT(m.m_firstname,'',m.m_name,' ',m.m_lastname) as stName
, t.sc_name
, tbl_data1.m_id
FROM tbl_data1
INNER JOIN tbl_member AS m ON (tbl_data1.m_id = m.m_id)
INNER JOIN tbl_school as t ON (t.sc_id = m.m_scho)
) as a
GROUP BY m_id ";