PDA

View Full Version : is this code have problem??


squawell
12-09-2001, 03:38 PM
$countposts=$DB_site->query_first("SELECT count(*) AS posts FROM post WHERE userid='$bbuserinfo[userid]'");
$todays=number_format($countposts[userposts]);


this code is work but not perfect~~~

when i use admin account login it seems normal but i use member

account it seems wrong~~

for example:

admin login:show 11 posts--this is right!!

member login:show 0 or 1 posts--this is wrong!!

why??

Admin
12-09-2001, 03:44 PM
Maybe the user you are using to login doesn't have any posts?

squawell
12-09-2001, 03:54 PM
but i want it show up the forum topposter's post number

so if this code work whatever anyone login it should show up

the topposter's post number~~~

bira
12-09-2001, 04:05 PM
$bbuserinfo[userid] is the id of the current viewer of the page.

If you are looking at the page logged in as user X who has 11 posts, it will show 11. If you are logged in as user Y who has 0 posts, it will show 0.

squawell
12-09-2001, 04:25 PM
so now, how i to do can make it just like my last post say that

way??