News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

"Updated Topics" error

Started by shapeshifter, May 13, 2016, 04:51:13 PM

Previous topic - Next topic

shapeshifter

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.

live627


shapeshifter

Quote from: live627 on May 13, 2016, 07:40:53 PM
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.

Kindred

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
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

shapeshifter

Quote from: Kindred 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

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.

shapeshifter

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.

Suki

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.

shapeshifter

Quote from: Suki 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.


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. :)

qc

@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 :)

Suki

Quote from: qc on May 14, 2016, 11:36:55 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.

shapeshifter

Quote from: qc 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? :(

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.

Suki

Quote from: shapeshifter on May 14, 2016, 11:34:51 AM
Quote from: Suki 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.


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.

qc

@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 :)

shapeshifter

Quote from: Suki on May 14, 2016, 11:55:21 AM
Quote from: shapeshifter on May 14, 2016, 11:34:51 AM
Quote from: Suki 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.


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

shapeshifter

#14
Quote from: qc 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?

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. ;)

qc

@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 :)

shapeshifter

Quote from: qc 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?

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.

qc

Well, if you execute the following SQL query...
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...
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? $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 :)

shapeshifter

Quote from: qc on May 14, 2016, 01:13:23 PM
Well, if you execute the following SQL query...
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...
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? $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.)

qc

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 :)

Advertisement: