vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Any Issue With This Query? (Inside) (https://vborg.vbsupport.ru/showthread.php?t=224747)

paul41598 10-07-2009 12:21 PM

Any Issue With This Query? (Inside)
 
Can anyone spot any issues with this query? I wrote it and I thought it worked, but there are some issues with it it seems. What I have basically is checkboxes and usergroup names next to each checkbox. When you check each usergroup it sends an email.

PHP Code:

$usergroups2 $vbulletin->db->query_read("
    SELECT email, username, usergroupid, membergroupids
    FROM " 
TABLE_PREFIX "user
    WHERE usergroupid IN (
$groupids)
   OR membergroupids IN (
$groupids)
    OR FIND_IN_SET('
$groupids', membergroupids)

"
); 

My problem is...if I select Administrators for example and "Custom Group", I can only get it to print out the 2 people who are apart of the Administrators group. The additional users (4) of them who are apart of the "Custom Group" do not print out on my screen even though they should. 6 total should actually.

I don't get why the query wouldnt work entirely. If I select only the custom group and not the Administrators, then the 4 people show up fine.

--------------- Added [DATE]1254931725[/DATE] at [TIME]1254931725[/TIME] ---------------

I think I've figured out that my FIND_IN_SET is wrong. You can only search 1 value, not multiple. So how do I get around that?


All times are GMT. The time now is 03:48 PM.

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.00883 seconds
  • Memory Usage 1,710KB
  • 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
  • (1)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