vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Need help with a query (https://vborg.vbsupport.ru/showthread.php?t=66230)

Mijae 06-16-2004 06:04 PM

Need help with a query
 
I cant make it work!

I need a query that takes the 5 most played games from the arcade.

Anyone can help me?

Boofo 06-16-2004 08:26 PM

Try this:

PHP Code:

// <!-- TOP ARCADE GAMES -->
 
$mostactive $DB_site->query_first("
   SELECT COUNT(*) as total, gamesessions.gamename, games.title, games.gameid, MAX(gamesessions.score) as score, user.username, user.userid
   FROM "
.TABLE_PREFIX."gamesessions AS gamesessions
   INNER JOIN " 
TABLE_PREFIX "games AS games ON(gamesessions.gamename = games.shortname)
   INNER JOIN " 
TABLE_PREFIX "user AS user ON(games.highscorerid = user.userid)
   WHERE gamesessions.valid=1
   GROUP BY gamesessions.gamename
   ORDER BY total
   DESC LIMIT 0,5
"
); 


Mijae 06-16-2004 10:27 PM

Ok, I'll work on the templates later on and see if it works :D

Boofo 06-16-2004 10:36 PM

Quote:

Originally Posted by Mijae
Ok, I'll work on the templates later on and see if it works :D

It works. It the same one I use on my site for the top game. I just made it the top 5 for you.

Mijae 06-16-2004 10:47 PM

Want to give me the template code then and save me pain and agony? :P

Boofo 06-16-2004 10:56 PM

Yours would be different than mine since you have 5. ;)

Mijae 06-16-2004 11:29 PM

Give me what you have and I'll work from there :P

EDIT: Ok, I cant get it to work, I need your code :D

Mijae 06-17-2004 10:41 PM

Quote:

Originally Posted by Mijae
Give me what you have and I'll work from there :P

EDIT: Ok, I cant get it to work, I need your code :D

Bump :D

Boofo 06-17-2004 11:12 PM

Have you tried using this in the template?

$mostactive[title]

Mijae 06-18-2004 12:05 AM

I hate you.

What other variables can I use? :P

Also, since I want 5 of those to appear, do I have to create a template with the code in it, and then call that template into arcade_main for example? This is new to me :P

EDIT: damn, I am so lost.


All times are GMT. The time now is 11:37 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.01027 seconds
  • Memory Usage 1,728KB
  • 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
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete