vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   [help]i need a little help (https://vborg.vbsupport.ru/showthread.php?t=33230)

squawell 12-15-2001 05:37 PM

this is the problem code:

PHP Code:

$fileviews=$DB_site->query_first("SELECT count(*) AS profileviews FROM user ORDER BY profileviews DESC LIMIT 1");
$proviews=$fileviews['profileviews']; 

but the $proviews=totalmembers what's wrong??


hope anybody help me finish it~~plz~~~:D

amykhar 12-15-2001 05:56 PM

all this query did was count the total number of users and store it in a variable called profileviews. What are you trying to calculate?

Amy

squawell 12-15-2001 06:44 PM

i want to calculate the top profileviews of forum member!!

just like :

The Top Profileview:username(numbertimes)!!

any idea?? :confused:

amykhar 12-15-2001 07:17 PM

assuming that you have been counting the profile views, it's simple.

Select profileviews as profileviews from user order by profileviews DESC;

That will order them from highest to lowest. You just grab as many as you need then. If you only need the top 5 or so, you can add a LIMIT 5 at the end.

If you haven't been incrementing that field when somebody looks at a user's profile though, that query won't do anything for you.

Amy

squawell 12-15-2001 07:45 PM

thankz amy~~~:D

now it's work!!

another question

if i want the top 5 show up with pop up window how should i do?

any idea?


All times are GMT. The time now is 10:31 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01862 seconds
  • Memory Usage 1,715KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete