The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Moving users into a user group based on signature url and ...
Ok so I'm trying to move users from the registered user group into another user group if they have a certain url in their signature, have zero posts, and a certain lastvisit time.
This is the query I came up with; Code:
UPDATE user SET usergroupid = 3 WHERE (SELECT userid FROM usertextfield WHERE signature LIKE 'google') AND posts = 0 AND lastvisit = 1342328885 No users get moved Yes I have one user with the signature of www.google.com with zero posts and a lastvisit of 1341119285. Doesn't do anything different if I replace = with another symbol ( < > <= >= ) in the lastvisit clause. |
#2
|
|||
|
|||
I have to be honest and say that I don't fully understand your query, with a SELECT in there like that, so it that may be OK. But I think you want to use LIKE '%google%'. In any case, I probably would have done this:
Code:
UPDATE user LEFT JOIN usertextfield ON (user.userid = usertextfield.userid) SET usergroupid = 3 WHERE signature LIKE '%google%' AND posts = 0 AND lastvisit = 1342328885 |
#3
|
|||
|
|||
I got that select bit from reading over at stackoverflow, was pretty sure it wouldn't work but it didn't spit out an error either
Your suggestion did not work either I had tried using a JOIN (left and right) and neither worked, which is why I had nothing to lose by trying the query I posted |
#4
|
||||
|
||||
Did you try this?
Code:
UPDATE user SET usergroupid = 3 WHERE (SELECT userid FROM usertextfield WHERE signature LIKE '%google%') AND posts = 0 AND lastvisit = 1342328885 |
#5
|
|||
|
|||
Quote:
Quote:
|
#6
|
|||
|
|||
Hi I did indeed, the query executed successfully, but the users user group wasn't changed.
It might be an issue with the user, I'll have to adjust the lastactive time and see if that works. --------------- Added [DATE]1347775503[/DATE] at [TIME]1347775503[/TIME] --------------- So I decided I could live without using lastvisit since I'm already checking signature url and post count. Code:
UPDATE user LEFT JOIN usertextfield ON (user.userid = usertextfield.userid) SET usergroupid = 3 WHERE signature LIKE '%google%' AND posts = 0 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|