vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Ignoring Custom Titles (https://vborg.vbsupport.ru/showthread.php?t=73767)

mawby 01-07-2005 02:07 PM

ok, couldn't get the e-mail working but by trial and error I've traced the problem to the first SQL query. If I put it into plain SQL like...
Code:

UPDATE user AS user SET customtitle = 0 WHERE customtitle = 2 AND user.usergroupid IN (SELECT usergroupid FROM usergroup where (genericpermissions & 2048) = 0)
and run it through mySQL it returns the following error...
Quote:

#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT usergroupid FROM usergroup where (genericpermissions & 2
...and I'm using mySQL version 4.0.22-nt

Does that give any clues?

Marco van Herwaarden 01-07-2005 03:47 PM

Hmm running MySQL 4.1.8nt myself, but the functions used in there are nothing new i think. I copied your sql statement back into my sql manageer and it worked like a charm. Strange.

Hmm MySQL documentation not clear on this, but it might be that the IN statement not work like expected in your version of mysql (http://dev.mysql.com/doc/mysql/en/Co...s.html#IDX1235)

Try changing the line:
PHP Code:

AND user.usergroupid IN (SELECT usergroupid FROM " . TABLE_PREFIX . "usergroup where (genericpermissions 2048) = 0)"); 

into:

PHP Code:

AND user.usergroupid ANY (SELECT usergroup.usergroupid FROM " . TABLE_PREFIX . "usergroup AS usergroup where (usergroup.genericpermissions 2048) = 0)"); 

See also:
http://dev.mysql.com/doc/mysql/en/AN...ubqueries.html

mawby 01-07-2005 05:29 PM

Still doesn't work mate, says there's an error near "(SELECT usergroup.usergroupid ". :(

I can see what the SQL is trying to do, is there a way to move the logic out into the PHP maybe?

Marco van Herwaarden 01-07-2005 06:21 PM

Give me a litle time, will try to rewrite it tonight (CET)

Marco van Herwaarden 01-07-2005 07:50 PM

1 Attachment(s)
Ok a new attempt. Should work on all mySQL version now.

Replace the file and try again.

mawby 01-09-2005 08:48 AM

Mate you're a star, that worked perfectly!

Cheers!

:banana:

Marco van Herwaarden 01-09-2005 09:43 AM

Thanks for the feedback.

Since more people seem to be looking for this, i might change it to include also membergroups and release it as a mini mod.

djroketboy 06-04-2005 02:37 PM

Quote:

Originally Posted by MarcoH64
Thanks for the feedback.

Since more people seem to be looking for this, i might change it to include also membergroups and release it as a mini mod.

I'm about to install this, seeing I am having this issue as well, is there a way to set which usergroups are affected? i only need 2 groups, 1 paid members, and 2 free members that need to be used, the rest can be left as default.


All times are GMT. The time now is 07:31 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.01181 seconds
  • Memory Usage 1,738KB
  • 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_code_printable
  • (2)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
  • (8)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