if($bbuserinfo[userid]!=0 and $post[userid] !=0){ $usertherd = $DB_site->query_first("SELECT COUNT(threadid) AS total FROM thread WHERE postuserid=$post[userid] "); $usertherdcoun = $usertherd[total]; $userpostdcoun = $post[posts] - $usertherdcoun ; }