php - How to send SQL count data & array data together? -
i have script designed print out values of students have accrued more 3 tardies. want script print out both student name, , amount of times they've been tardy, far i've been able print out names following script: $sql = "select distinct studentid,classid,date attendance_main status = 'tardy' , classid '%adv%'"; $result = mysql_query($sql) or die (mysql_error()); while($row=mysql_fetch_array($result)) { $studentid = $row['studentid']; $sql2 = "select distinct studentid,classid,date attendance_main studentid = '$studentid' , status = 'tardy' , classid '%adv%'"; $result2 = mysql_query($sql2) or die (mysql_error()); while($row2=mysql_fetch_array($result2)) { $tardycount = mysql_num_rows($result2); $studentid = $row2['studentid']; if($tardycount >= 3) { $sql3 = "select * students rf...