vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Please Help (https://vborg.vbsupport.ru/showthread.php?t=81350)

babolo 05-12-2005 02:53 AM

Please Help
 
I am trying to make a top 10 poster in my php include. This is what I have so far.
PHP Code:

$result mysql_query("SELECT userid,username,posts
        FROM user
        ORDER BY posts
        DESC LIMIT 10"
);

        
$s mysql_fetch_array($resultMYSQL_NUM);
        
$userid $s[0];
        
$username $s[1];
        
$posts $s[2];
        

        
$topposters "Our top poster is <a href=\"member.php?u=".$s[0]."\">".$s[1]."</a>(".$s[2].")"

can somebody please help me so I can get the top posters?

Marco van Herwaarden 05-12-2005 09:35 AM

try with:
PHP Code:

$username $s['username']; 


babolo 05-12-2005 01:25 PM

The coding wqorks fine. Its just my problem is I need help turning it into the top 10 posters instead of the just the top poster.

Marco van Herwaarden 05-12-2005 03:31 PM

Then use:
PHP Code:

$result mysql_query("SELECT userid,username,posts 
FROM user 
ORDER BY posts 
DESC LIMIT 10"
); 
 
while (
$s mysql_fetch_array($resultMYSQL_NUM))
{
.......
your work here......



babolo 05-12-2005 07:47 PM

Nope doesnt work. :( Is there anyone else who could help, or do you have anymore suggestions?

Actually it did work... but I still have a problem. I have to figure out how to put it under the stats section.

PHP Code:

$result $DB_site->query("SELECT userid,username,posts 
          FROM user 
          ORDER BY posts 
          DESC LIMIT 10"
); 


while (
$s $DB_site->fetch_array($resultMYSQL_NUM))
{
        echo 
"<a href=\"member.php?u=".$s[0]."\">".$s[1]."</a>(".$s[2].")";


thats my code.

Ok I got everything working fine now


All times are GMT. The time now is 11:17 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.01040 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
  • (4)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