$sql = "SELECT * FROM books LEFT JOIN users
ON books.readby=users.user_id WHERE users.email IS NOT NULL";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))
{
echo $row['readby']. " - read 10 books";
} //while ends
this is the code I have so far. I am trying to retrieve the number of books read by each user and echo the results. echo the user_id and number of books he/she read books table is like this : id - name - pages - readby the row readby contains the user id.any ideas/suggestions? I was thinking about using count() but Im not sure how to go about doing that.