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(); ?>

name?>

name; $id = $user->id; $login = makeDate($user->last_login); if($posts == 0){ $reportedPostsPercent = 0; }else{ $reportedPostsPercent = round($reportedPosts/$posts); } if($comments == 0){ $reportedCommentsPercent = 0; }else{ $reportedCommentsPercent = round($reportedComments/$comments); } echo "

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%

User's page

"; ?>