Error Invalid SQL: SELECT tag.tagtext, tagnode.userid, tag.tagid, count(tag.tagid)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Blackhorse
    Senior Member
    • Jul 2018
    • 298
    • 5.3.x

    Error Invalid SQL: SELECT tag.tagtext, tagnode.userid, tag.tagid, count(tag.tagid)

    When I try to edit post of member to add tags to the topic it gives me this error:
    • Error Invalid SQL: SELECT tag.tagtext, tagnode.userid, tag.tagid, count(tag.tagid) AS nr FROM tag AS tag JOIN tagnode AS tagnode ON (tag.tagid = tagnode.tagid) WHERE tag.tagtext LIKE 'السينو%' GROUP BY tag.tagid ORDER BY nr DESC, tag.tagtext ASC LIMIT 25 OFFSET 0 /** getPopularTags **/;
    What is this and how could we solve?
  • Blackhorse
    Senior Member
    • Jul 2018
    • 298
    • 5.3.x

    #2
    What I have noticed is that tag table has empty tag columns after i tried to import (there was a duplicate error) so not imported !

    Tagnode is imported and full of info, Tag is not!

    Is there any harm from leaving Tag empty?

    Can I rebuild tags automatically?

    Wayne Luke

    Comment

    • Wayne Luke
      vBulletin Technical Support Lead
      • Aug 2000
      • 73979

      #3
      The tag table is the entire basis of tags. You cannot rebuild this because the fundamental tag data is missing. The tagnode table just links a tag with a node. It contains - nodeid, tagid, userid, and a date. It has no information on the actual tag being used. You're getting the error because there is no correlating tagid if they were not imported.

      You can try importing your old tag table manually. However, I don't know if the upgrade process changes the actual tagids in the table during its process. If that doesn't work, you would need to truncate the tagnode table and start applying tags to your content from the beginning again.
      Translations provided by Google.

      Wayne Luke
      The Rabid Badger - a vBulletin Cloud demonstration site.
      vBulletin 5 API

      Comment

      • Blackhorse
        Senior Member
        • Jul 2018
        • 298
        • 5.3.x

        #4
        Hello Wayne,

        i have imported the tag and it is well connected now with the tagnode. But i have made a mistake which caused the new tags to be without tag id but null. I want an SQL qyery which puts any new tag in the successive id order

        e.g: tags should be entered in tables with successive unoque tagid:

        tagid 45 hello
        tagid 46 hi
        tagid 47 yes

        But now app new tags are appeaeing like this:


        tagid 45 hello
        tagid 46 hi
        tagid 47 yes
        tagid NULL when
        tagid NULL who


        how can i restore the normal successive tagids for new tags?

        thanx

        Comment

        • Blackhorse
          Senior Member
          • Jul 2018
          • 298
          • 5.3.x

          #5
          Here is an example to what i mean:

          Click image for larger version

Name:	Untitled.png
Views:	120
Size:	131.8 KB
ID:	4414528

          Comment

          • Wayne Luke
            vBulletin Technical Support Lead
            • Aug 2000
            • 73979

            #6
            That field should be an auto-increment field. I don't know of a query to fix a missing auto-increment value. You'll have to manually update each record so that it has a unique value. Then you'll need to edit the table's properties to make sure the field is auto-increment and its next value is higher than your max tagid.
            Translations provided by Google.

            Wayne Luke
            The Rabid Badger - a vBulletin Cloud demonstration site.
            vBulletin 5 API

            Comment

            • Blackhorse
              Senior Member
              • Jul 2018
              • 298
              • 5.3.x

              #7
              Thank you Wayne,

              it is fixed now and got it back to auto-increment

              Comment

              Related Topics

              Collapse

              Working...