Announcement

Collapse
No announcement yet.

SQL errors; Invalid SQL: SELECT attachmentid

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

  • SQL errors; Invalid SQL: SELECT attachmentid

    Error #1
    Database error in vBulletin 3.0.3:

    Invalid SQL: SELECT attachmentid, COUNT(*) AS views FROM attachmentviews GROUP BY attachmentid
    mysql error: Unknown column 'attachmentid' in 'field list'

    mysql error number: 1054

    Date: Monday 29th of November 2004 11:10:12 AM
    Script: http://www.bwimports.org/forums/cron.php?&rand=499934
    Referer: http://www.bwimports.org/forums/show...=3890#post3890


    Those are the errors I keep getting from my DB. About a week ago, we ran out of disk space by accident (script was parsing through some stuff, file got real big over a few days) and then the DB crashed. Got that fixed, and now I keep getting these two errors.

    First I tried to fix/repair the tables. Didn't work. Then I tried deleting the two tables, recreating them, and then fixing/repairing them, still no dice. So now, after getting an email with a DB error everytime someone posts, I decided to ask the pros. Can someone please help me?

  • #2
    The attachmentviews table should have an attachmentid column. Try dropping the table and running this query to recreate it:

    CREATE TABLE attachmentviews (
    attachmentid INT UNSIGNED NOT NULL DEFAULT '0',
    KEY postid (attachmentid)
    )

    Comment


    • #3
      Originally posted by Jake Bunce
      The attachmentviews table should have an attachmentid column. Try dropping the table and running this query to recreate it:

      CREATE TABLE attachmentviews (
      attachmentid INT UNSIGNED NOT NULL DEFAULT '0',
      KEY postid (attachmentid)
      )
      ok, ran:

      DROP TABLE attachmentviews

      then

      CREATE TABLE attachmentviews (
      attachmentid INT UNSIGNED NOT NULL DEFAULT '0',
      KEY postid (attachmentid)
      )

      we'll see if that works. Thanks

      Comment

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