Advertisement:

Author Topic: "Updated Topics" error  (Read 5897 times)

Offline shapeshifter

  • Semi-Newbie
  • *
  • Posts: 29
"Updated Topics" error
« on: May 13, 2016, 04:51:13 PM »
I'm getting the same error now. It's also an upgrade and the "unwatched" column is in the database. Anyone have any ideas? TIA

Database Error
Unknown column 'lt.unwatched' in 'where clause'
File: .../forum/Sources/Recent.php
Line: 891

Split from year old topic and error code pasted into this message from that topic.  Please avoid raising old topics in high traffic boards like this one in the future - Iris.
« Last Edit: May 13, 2016, 05:21:33 PM by Irisado »

Offline live627

  • Development Contributor
  • SMF Hero
  • *
  • Posts: 5,620
  • Gender: Male
    • live627 on Facebook
    • live627 on GitHub
    • live627 on LinkedIn
    • @live627 on Twitter
    • livemods
Re: "Updated Topics" error
« Reply #1 on: May 13, 2016, 07:40:53 PM »
This was fixed ages ago.
Try not to become a man of success, but rather try to become a man of value.
- Albert Einstein

Offline shapeshifter

  • Semi-Newbie
  • *
  • Posts: 29
Re: "Updated Topics" error
« Reply #2 on: May 14, 2016, 09:57:43 AM »
This was fixed ages ago.

Umm, maybe, but not for me. I'm using the latest version, 2.1 beta 2, and I assure you I'm not imagining it.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,502
  • Gender: Male
    • Kindred-999 on GitHub
Re: "Updated Topics" error
« Reply #3 on: May 14, 2016, 10:40:40 AM »
What do YOU mean by "latest" version?

Because the beta2 from our diwnload site is now outdated... the latest version, on github is almost ready for beta3
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline shapeshifter

  • Semi-Newbie
  • *
  • Posts: 29
Re: "Updated Topics" error
« Reply #4 on: May 14, 2016, 11:05:42 AM »
What do YOU mean by "latest" version?

Because the beta2 from our diwnload site is now outdated... the latest version, on github is almost ready for beta3

So...if I install the latest update from the github site, it will fix the issue? Maybe it would have been better for me, and saved us all time, if someone had just helpfully told me that you need to get the latest development update from github to fix the problem.

Offline shapeshifter

  • Semi-Newbie
  • *
  • Posts: 29
Re: "Updated Topics" error
« Reply #5 on: May 14, 2016, 11:17:18 AM »
And for the record, the latest github download did not fix the issue. So... I guess I'll just wait till beta 3 is actually finished, which will hopefully resolve it.

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,551
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: "Updated Topics" error
« Reply #6 on: May 14, 2016, 11:30:46 AM »
DB related errors cannot be solved by just uploading a fresh set of files, you need to either run the upgrade process again or manually add/remove the DB column. Yes, this is why we don't encourage installing a beta on your production forum.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline shapeshifter

  • Semi-Newbie
  • *
  • Posts: 29
Re: "Updated Topics" error
« Reply #7 on: May 14, 2016, 11:34:51 AM »
DB related errors cannot be solved by just uploading a fresh set of files, you need to either run the upgrade process again or manually add/remove the DB column. Yes, this is why we don't encourage installing a beta on your production forum.


I just ran the upgrade process again, and the problem remains. And the DB columns are all there, so I'm not sure what I'd need to change. And I'm not using it on a live site. But thank you for not treating me like an enemy combatant. :)

Offline qc

  • Jr. Member
  • **
  • Posts: 140
Re: "Updated Topics" error
« Reply #8 on: May 14, 2016, 11:36:55 AM »
@shapeshifter

I found that the 'unwatched' column is added by 'other/upgrade_2-1_mysql.sql' - perhaps you could try running 'other/upgrade.php' and see if that fixes this issue for you - if not, you could try to manually run the SQL file (e.g. use phpmyadmin or similar tools after making a backup).

PS: Why am the first one actually addressing the issue instead of putting blame on @shapeshifter, whose only mistake is trusting the SMF download section being up to date? :(
Playing quizduell? Having quizduell questions? Our german quizduell forum quizcommunity.de is looking for quiz freaks to come and play quizduell with us :)

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,551
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: "Updated Topics" error
« Reply #9 on: May 14, 2016, 11:40:06 AM »

PS: Why am the first one actually addressing the issue instead of putting blame on @shapeshifter, whose only mistake is trusting the SMF download section being up to date? :(

No one is putting any blame on anyone.  I already adressed the issue.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline shapeshifter

  • Semi-Newbie
  • *
  • Posts: 29
Re: "Updated Topics" error
« Reply #10 on: May 14, 2016, 11:54:28 AM »
@shapeshifter

I found that the 'unwatched' column is added by 'other/upgrade_2-1_mysql.sql' - perhaps you could try running 'other/upgrade.php' and see if that fixes this issue for you - if not, you could try to manually run the SQL file (e.g. use phpmyadmin or similar tools after making a backup).

PS: Why am the first one actually addressing the issue instead of putting blame on @shapeshifter, whose only mistake is trusting the SMF download section being up to date? :(

This is what the current db structure looks like now, if anyone notices anything amiss feel free to point it out:



But thanks, qc. Maybe I'll try a new install later and see how it goes. I suspect it might not be a problem if I did a completely new install, but I upgraded an old 2.0 forum with existing database and I'm guessing that's at the root of the problem, somehow.

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,551
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: "Updated Topics" error
« Reply #11 on: May 14, 2016, 11:55:21 AM »
DB related errors cannot be solved by just uploading a fresh set of files, you need to either run the upgrade process again or manually add/remove the DB column. Yes, this is why we don't encourage installing a beta on your production forum.


I just ran the upgrade process again, and the problem remains. And the DB columns are all there, so I'm not sure what I'd need to change. And I'm not using it on a live site. But thank you for not treating me like an enemy combatant. :)


Run this on your hosting's phpmyadmin or similar:

ALTER TABLE {$db_prefix}log_topics
ADD COLUMN unwatched TINYINT(3) NOT NULL DEFAULT '0';

UPDATE {$db_prefix}log_topics
SET unwatched = 0;

replace {db_prefix} with the actual prefix of your tables.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline qc

  • Jr. Member
  • **
  • Posts: 140
Re: "Updated Topics" error
« Reply #12 on: May 14, 2016, 12:15:14 PM »
@shapeshifter Is that the structure of the log_topics table? If yes, is the error message you are now getting exactly as stated in your initial posting?
Playing quizduell? Having quizduell questions? Our german quizduell forum quizcommunity.de is looking for quiz freaks to come and play quizduell with us :)

Offline shapeshifter

  • Semi-Newbie
  • *
  • Posts: 29
Re: "Updated Topics" error
« Reply #13 on: May 14, 2016, 12:19:05 PM »
DB related errors cannot be solved by just uploading a fresh set of files, you need to either run the upgrade process again or manually add/remove the DB column. Yes, this is why we don't encourage installing a beta on your production forum.


I just ran the upgrade process again, and the problem remains. And the DB columns are all there, so I'm not sure what I'd need to change. And I'm not using it on a live site. But thank you for not treating me like an enemy combatant. :)


Run this on your hosting's phpmyadmin or similar:

ALTER TABLE {$db_prefix}log_topics
ADD COLUMN unwatched TINYINT(3) NOT NULL DEFAULT '0';

UPDATE {$db_prefix}log_topics
SET unwatched = 0;

replace {db_prefix} with the actual prefix of your tables.

Okay, I'm guessing by the error I got that I maybe picked a wrong server db option during the initial upgrade, because I'm seeing this:

Quote
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '{$db_smf}log_topics
ADD COLUMN unwatched TINYINT(3) NOT NULL DEFAULT '0'' at line 1


I don't know anything about MariaDB, so I confess the fault may have been entirely mine. I'll have to see about a complete redo when I get the time. Thank you

Offline shapeshifter

  • Semi-Newbie
  • *
  • Posts: 29
Re: "Updated Topics" error
« Reply #14 on: May 14, 2016, 12:22:19 PM »
@shapeshifter Is that the structure of the log_topics table? If yes, is the error message you are now getting exactly as stated in your initial posting?

Yes, and the exact error is:

Database Error
Unknown column 'lt.unwatched' in 'where clause'
File: /home/..../public_html/forum/Sources/Recent.php
Line: 891

But see my last post above. I may have upgraded incorrectly. I make no claims to being very bright when it comes to all this db stuff. ;)
« Last Edit: May 14, 2016, 12:35:12 PM by shapeshifter »

Offline qc

  • Jr. Member
  • **
  • Posts: 140
Re: "Updated Topics" error
« Reply #15 on: May 14, 2016, 12:42:49 PM »
@shapeshifter You need to replace {$db_prefix} in the code Suki gave you with the correct database prefix, i.e. {$db_prefix}log_topics must be replaced with the correct / full name of the log_topics table in your database.

It seems that right now, you just replaced it with {$db_smf} ? Perhaps your database prefix is not set up correctly in your Settings.php?
Playing quizduell? Having quizduell questions? Our german quizduell forum quizcommunity.de is looking for quiz freaks to come and play quizduell with us :)

Offline shapeshifter

  • Semi-Newbie
  • *
  • Posts: 29
Re: "Updated Topics" error
« Reply #16 on: May 14, 2016, 01:03:43 PM »
@shapeshifter You need to replace {$db_prefix} in the code Suki gave you with the correct database prefix, i.e. {$db_prefix}log_topics must be replaced with the correct / full name of the log_topics table in your database.

It seems that right now, you just replaced it with {$db_smf} ? Perhaps your database prefix is not set up correctly in your Settings.php?

I actually tried every combination I could think of, just because I didn't count on myself to know what I was doing, but every one resulted in an error. The table is named "smf_log_topics." Would you mind writing out the query for more me just so that I know it's idiot-proof? If I copy and paste it and it still doesn't work, at least I'll know I'm not going crazy.

Offline qc

  • Jr. Member
  • **
  • Posts: 140
Re: "Updated Topics" error
« Reply #17 on: May 14, 2016, 01:13:23 PM »
Well, if you execute the following SQL query...
Code: [Select]
ALTER TABLE smf_log_topics
ADD COLUMN unwatched TINYINT(3) NOT NULL DEFAULT '0';
...you might get an error, because you already seem to have that "unwatched" column in your smf_log_topics table.

But if you execute...
Code: [Select]
UPDATE smf_log_topics
SET unwatched = 0;
...you should not get any error, right?

Can you confirm that the Settings.php in your forum root folder contains the following entry?
Code: [Select]
$db_prefix = 'smf_';
Playing quizduell? Having quizduell questions? Our german quizduell forum quizcommunity.de is looking for quiz freaks to come and play quizduell with us :)

Offline shapeshifter

  • Semi-Newbie
  • *
  • Posts: 29
Re: "Updated Topics" error
« Reply #18 on: May 14, 2016, 01:22:08 PM »
Well, if you execute the following SQL query...
Code: [Select]
ALTER TABLE smf_log_topics
ADD COLUMN unwatched TINYINT(3) NOT NULL DEFAULT '0';
...you might get an error, because you already seem to have that "unwatched" column in your smf_log_topics table.

But if you execute...
Code: [Select]
UPDATE smf_log_topics
SET unwatched = 0;
...you should not get any error, right?

Can you confirm that the Settings.php in your forum root folder contains the following entry?
Code: [Select]
$db_prefix = 'smf_';

Okay, believe it or not, I'd just figured it out before you replied, but thank you. I was thinking I had to include the brackets in the command, rather than realizing they were basically just a parenthetical reference. Doh. Anyway, you are correct, I did get a duplicate column error. I tried your command and it executed but it didn't fix the problem, unfortunately. And yes, I can confirm that Settings.php has the correct entry: $db_prefix = 'smf_'; (That's a copy and paste from the file.)

Offline qc

  • Jr. Member
  • **
  • Posts: 140
Re: "Updated Topics" error
« Reply #19 on: May 14, 2016, 02:31:43 PM »
It seems your database is correct.

* Are you using the correct database in your Settings.php or perhaps pointing to another, older one?
* Did you download the most up-to-date code from https://github.com/SimpleMachines/SMF2.1/archive/release-2.1.zip (note that it is the release-2.1 branch, not master or development)?
Playing quizduell? Having quizduell questions? Our german quizduell forum quizcommunity.de is looking for quiz freaks to come and play quizduell with us :)