prepare("SELECT * FROM forums WHERE poster_id = :usr"); $stmt->bindparam(":usr", $user->id); $stmt->execute(); $posts = $stmt->rowCount(); //Getting the number of comments $stmt = $conn->prepare("SELECT * FROM comments WHERE poster_id = :usr"); $stmt->bindparam(":usr", $user->id); $stmt->execute(); $comments = $stmt->rowCount(); //Getting the number of reported posts made by user $stmt = $conn->prepare("SELECT * FROM forums WHERE poster_id = :usr AND reports IS NOT NULL"); $stmt->bindparam(":usr", $user->id); $stmt->execute(); $reportedPosts = $stmt->rowCount(); //Getting the number of reported comments made by user $stmt = $conn->prepare("SELECT * FROM comments WHERE poster_id = :usr AND reports IS NOT NULL"); $stmt->bindparam(":usr", $user->id); $stmt->execute(); $reportedComments = $stmt->rowCount(); ?>
Last login: $login
Posts made: $posts
Reported posts made: $reportedPosts
Percent of posts reported: $reportedPostsPercent%
Comments made: $comments
Reported comments made: $reportedComments
Percent of comments reported: $reportedCommentsPercent%
"; ?>