 <p>If all you need to know if its admin, don't bring all fields from CommunityMembers. Try this</p> <pre><code>$sql = $dbc-&gt;prepare(" SELECT DISTINCT cm.Power, com.* FROM Community com LEFT JOIN CommunityMembers cm ON cm.UseriID=com.CreaterByUser WHERE cm.UserID = '" . $_SESSION['UserID'] . "'"); </code></pre> <p>Didn't test it, but this should work even without DISTINCT.</p>