SQL Update to Subscribe Users to Forums

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ctrl-alt-del
    Senior Member
    • Jul 2006
    • 111
    • 3.6.x

    SQL Update to Subscribe Users to Forums

    Looking for assistance and direction in getting an SQL command that will subscribe users to forums.

    Thanks!
    Matt
    phpBB Convert
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    Use a query like this:

    Code:
    INSERT INTO subscribeforum (userid, forumid, emailupdate)
    VALUES ([color=red]X[/color], [color=red]Y[/color], [color=red]Z[/color])
    X = the userid of the subscribed user
    Y = the forumid of the subscribed forum
    Z = one of these numbers:
    0 = No email notification
    2 = Daily updates by email
    3 = Weekly updates by email

    Comment

    • ctrl-alt-del
      Senior Member
      • Jul 2006
      • 111
      • 3.6.x

      #3
      Thank you. That would mean a separate query for every user and every forum. Can there be a more general statement? Would that query accept wild cards?
      Matt
      phpBB Convert

      Comment

      • Jake Bunce
        Senior Member
        • Dec 2000
        • 46598
        • 3.6.x

        #4
        No, but you can put it into a custom PHP script to run it a bunch of times for multiple values or X / Y / Z. This is a www.vbulletin.org question.

        Comment

        • ctrl-alt-del
          Senior Member
          • Jul 2006
          • 111
          • 3.6.x

          #5
          Okay, that will work. I'm a noob so I need to find out the relationship between vB and vB.org.
          Matt
          phpBB Convert

          Comment

          • jdj
            Senior Member
            • Jan 2009
            • 824
            • 5.1.x

            #6
            Insert where?

            I'm also trying to (at the user's request) subscribe the user to a thread in order that they don't have to post, or find the Thread tools in order to subscribe. In reply to Jake's post which said:

            Use a query like this:

            Code:
            INSERT INTO subscribeforum (userid, forumid, emailupdate)VALUES (X, Y, Z)
            X = the userid of the subscribed user
            Y = the forumid of the subscribed forum
            Z = one of these numbers:
            0 = No email notification
            2 = Daily updates by email
            3 = Weekly updates by email

            My question is...insert where? Where do you put this query? Do you just copy and paste into that bit that says Manual Query under the Maintenance section of the AdminCP or do you have to go into MySQL to do it?

            Just tried inserting this piece of code into the Manual Query box of the Maintenance section of vB. Chose the userid number, forum id number, and 2 for "daily updates by email." The following error message was returned.

            An error occurred while attempting to execute your query. The following information was returned.
            error number: 1146
            error desc: Table 'vb_database.subscribeforum' doesn't exist


            Any clues?
            Last edited by jdj; Tue 8 Sep '09, 8:51am. Reason: Updating query having tested out the proposed solution

            Comment

            widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
            Working...