SQL Query to Update Attach Column in Post & Thread Tables

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fordforumsonline
    New Member
    • Jun 2012
    • 1
    • 3.8.x

    SQL Query to Update Attach Column in Post & Thread Tables

    Hello All!

    I was wondering if anyone with an understanding of SQL might be able to help me with a little problem I've got with my forum?

    One of my users had 'accidentally' deleted all of her attachments on our forum, but didn't notify us until a week or so later. I've tried to partially update my database with my limited knowledge of MySql and have done so but now facing a small issue.

    The attachments are showing in her profile, and when I log in as an admin and edit the post where the attachments are meant to be showing they are being displayed but they are not showing on the thread after I refresh the page. I contacted the vbulletin support who kindly told me what the issue was...

    Hi Paul

    There are two sets of data that need to be updated in your database for the attachments to show:

    - attach column in the post table
    - attach column in the thread table

    These values should be the total of the number of attachments for that post/thread. It should be possible to write a query that calculates the number for each post and updates the values there then a second query to add the values from the updated post table to update the thread one but you would need to post in the forums for further help with this as this is outside the realms of ticket support I'm afraid.

    Best regards,
    I have attached a couple of screenshots to help further identify the problem.

    Does anyone know how to write a query that could help solve my issue? Any help would be gratefully received,

    Regards,
    Paul

    Click image for larger version

Name:	Attachments being displayed when editing post.jpg
Views:	1
Size:	56.9 KB
ID:	3723945Click image for larger version

Name:	Attachments Posted by MissInformation.jpg
Views:	1
Size:	96.4 KB
ID:	3723946Click image for larger version

Name:	Posts not showing on thread.jpg
Views:	1
Size:	29.8 KB
ID:	3723947

Related Topics

Collapse

Working...