Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $results = mysql_query ("select t1.id, t1.firstname, t1.lastname, t2.student_id, t2.status, COUNT(t2.status) from mdl_user AS t1, attendance_records AS t2 WHERE t1.id = t2.student_id and t2.status='A'");
- // Query number of rows in rowset
- $nrows = mysql_num_rows($results);
- // Output
- echo "The query returned $nrows row(s):<br>";
- while($row = mysql_fetch_array($results))
- {
- print_r ($row);
- echo "<br>User ID: " . $row['id'] . "<br>First name: " . $row['firstname'] . "<br>Last Name: " . $row['lastname'] . "<br>Student_ID: " . $row['student_id'] . "<br>Status: " . $row['status'] . "<br>Count of status: " . $row['COUNT(t2.status)'];
- echo "<br />";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement