Advertisement
Guest User

techiem2

a guest
Feb 6th, 2009
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | None | 0 0
  1. $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'");      
  2. // Query number of rows in rowset
  3. $nrows = mysql_num_rows($results);
  4. // Output
  5. echo "The query returned $nrows row(s):<br>";
  6.  
  7. while($row = mysql_fetch_array($results))
  8. {
  9. print_r ($row);
  10. 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)'];
  11. echo "<br />";
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement