<?php
$sql = "SELECT
posts.post_id,
posts.post_by,
users.user_id,
users.user_name
FROM
posts
LEFT JOIN
users
ON
posts.post_by = users.user_id
WHERE
post_by = " . (int)$_SESSION['user_id'];
$result = mysql_query($sql) OR die(mysql_error());
$total = intval(mysql_num_rows($result));
if($posts > $total) {
$rank = 'User';
}else{
$rank = 'Super User';
}
?>