vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   While in mySQL - how would I do this query? (https://vborg.vbsupport.ru/showthread.php?t=158242)

kofoid 09-19-2007 10:37 PM

While in mySQL - how would I do this query?
 
I would like to run a query in mySQL that would show me all of the threads started by a certain user and all of the responses tied to the thread. Just like "Find all threads started by XXX" in a member's profile. Can someone help me out? Thanks in advance!

Eikinskjaldi 09-20-2007 06:00 AM

Quote:

Originally Posted by kofoid (Post 1342732)
I would like to run a query in mySQL that would show me all of the threads started by a certain user and all of the responses tied to the thread. Just like "Find all threads started by XXX" in a member's profile. Can someone help me out? Thanks in advance!

if its just the threads you want then its

[sql]select * from thread where postuserid=userid[/sql]

If you want all the posts in all these threads then its

[sql]select post.* from post p
join thread t using (threadid)
where postuserid=userid
order by p.threadid, p.postid[/sql]

kofoid 09-22-2007 07:13 PM

THANKS!

does that pull all threads and their responses as a single query? Also, is there any way to get it to run exactly like "Find all threads started by XXX," so it shows all pictures, signatures, etc? If not, is there a setting in the admin control panel that will allow someone to see ALL posts based on user group? That way I could set only the admin group to be able to see threads started by x, instead of only the last 100

Eikinskjaldi 09-23-2007 02:20 AM

Quote:

Originally Posted by kofoid (Post 1344755)
THANKS!

does that pull all threads and their responses as a single query?

Yes

Quote:

Also, is there any way to get it to run exactly like "Find all threads started by XXX," so it shows all pictures, signatures, etc?
Yes. A custom plugin to the appropriate script with some modifications to a few templates should do it.

Quote:

If not, is there a setting in the admin control panel that will allow someone to see ALL posts based on user group? That way I could set only the admin group to be able to see threads started by x, instead of only the last 100
Not that I am aware.


All times are GMT. The time now is 08:03 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.01075 seconds
  • Memory Usage 1,718KB
  • 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_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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