vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Combine these 2 queries? (https://vborg.vbsupport.ru/showthread.php?t=41869)

Boofo 08-03-2002 09:45 PM

Combine these 2 queries?
 
Can someone please tell me if the 2 following queries can be combined into one to pull out both pieces of information? And if so, how?

PHP Code:

$popularreply=$DB_site->query_first("SELECT * FROM thread ORDER by replycount DESC LIMIT 1"); 

and:

PHP Code:

$popularview=$DB_site->query_first("SELECT * FROM thread ORDER by views DESC LIMIT 1"); 


Admin 08-04-2002 05:25 AM

No, they can't be.

Boofo 08-04-2002 11:22 AM

Thanks, Chen. I kind of figured that, but thought it was worth a try.

Boofo 08-04-2002 12:21 PM

Is there a way to keep either one of those from being viewed by users that don't have permissions to view them? Like for a private forum and have it default to a second choice that is not private forums for those who can not view them?

Admin 08-05-2002 04:56 AM

Yes but it will add at least 3 more queries. If you want I'll give you the code.

Boofo 08-05-2002 04:58 AM

Yes, please, would you? I want to look at it and study it. I'll go ahead and use it since my forum is not very busy yet. :)

Quote:

Originally posted by FireFly
Yes but it will add at least 3 more queries. If you want I'll give you the code.

Boofo 08-06-2002 03:49 PM

Any luck on the code yet, Chen? :)

Admin 08-06-2002 04:25 PM

Oops, forgot. Use this function:
https://vborg.vbsupport.ru/showthrea...threadid=41934

Boofo 08-06-2002 05:49 PM

Can't say that I haven't had others feel the same. :( :)

Thanks for the code. I'll see if I can figure out how to use it.


All times are GMT. The time now is 07:26 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.01057 seconds
  • Memory Usage 1,725KB
  • 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
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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