Announcement

Collapse
No announcement yet.

SQL Query Help: Can you verify this query?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • SQL Query Help: Can you verify this query?

    Problem: Members do not close old threads before starting new ones.

    Solution I seek:
    Run an SQL query at the same the member attempts to start a new thread in that forum, closing all open threads by that user.

    SQL I managed to cobble together:
    Code:
    $forumid = forum ID;
    $username = $this->post['username'];
    $sql = "SET open = 0 FROM `thread` WHERE `forumid` = `$forumid` AND `postusername` = `$username` AND sticky = 0";
    Will it work? Thank you. Any feedback is greatly appreciated.

  • #2
    Or is this it?
    Code:
    $forumid = forum ID; 
    $username = $this->post['username'];
    $sql = "UPDATE thread SET open='0' WHERE forumid='x'  AND `forumid` = `$forumid` AND `postusername` = `$username` AND sticky = 0";"

    Comment


    • #4
      vBulletin.org isn't what it used to be.

      I am contacting the company that made the product. I am not looking for that company to support the product if it fails because I took some action, but I am looking for clarification on how to execute a particular MYSQL query.

      And it appears just over a month ago, one of your ranking staff members helped another user in the vB4 support forum:
      https://www.vbulletin.com/forum/show...D-1-more-thing

      This isn't an isolated incident either. People have been seeking help directly from members and from staff on this forum:
      http://lmgtfy.com/?q=site%3Avbulletin.com+mysql+query+

      It is really pathetic that vBulletin maintains a double standard. Maybe its discrimination against vB3 owners who don't want to pay the price to upgrade to vB4.

      If you want to keep your customers, stop denying them help when they try to manipulate your software to work for their community, or you will find they move to your competitors which are happy and willing to help.

      Comment


      • #5
        The difference is that you're asking for more than a simple query. You need plugins and hooks to make this work which requires PHP code.

        As for your query, I'd do it by user ID instead of username.

        UPDATE thread SET open = 0 WHERE userid= X AND forumid = Y
        Last edited by Wayne Luke; Fri 9th Dec '11, 2:04pm.
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud customization and demonstration site.
        vBulletin 5 Documentation - Updated every Friday. Report issues here.
        vBulletin 5 API - Full / Mobile
        I am not currently available for vB Messenger Chats.

        Comment


        • #6
          Originally posted by siliconfinance View Post
          vBulletin.org isn't what it used to be.

          I am contacting the company that made the product. I am not looking for that company to support the product if it fails because I took some action, but I am looking for clarification on how to execute a particular MYSQL query.

          And it appears just over a month ago, one of your ranking staff members helped another user in the vB4 support forum:
          https://www.vbulletin.com/forum/show...D-1-more-thing

          This isn't an isolated incident either. People have been seeking help directly from members and from staff on this forum:
          http://lmgtfy.com/?q=site%3Avbulletin.com+mysql+query+

          It is really pathetic that vBulletin maintains a double standard. Maybe its discrimination against vB3 owners who don't want to pay the price to upgrade to vB4.

          If you want to keep your customers, stop denying them help when they try to manipulate your software to work for their community, or you will find they move to your competitors which are happy and willing to help.
          In the time it took to write that rant, (and hunt out some random example) you could have simply posted your question on vb.org as requested. You appear to have been a member for over four years, so you should already be aware that is the normal procedure.
          Baby, I was born this way

          Comment

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