Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: carnaith on June 22, 2009, 02:33:53 PM

Title: Unknown column 'com.time' in 'field list'
Post by: carnaith on June 22, 2009, 02:33:53 PM
this happens when i click on profile

Unknown column 'com.time' in 'field list'
File: /home/fancya/public_html/Forum/Sources/Profile.php
Line: 1509

erm help please me thick
Title: Re: Unknown column 'com.time' in 'field list'
Post by: Kermit on June 22, 2009, 03:09:33 PM
A column with name com.time is not a default column on SMF ,so the error is regarding a new installed mod ,which has affect on Profile.php

Indeed because of this mod

http://custom.simplemachines.org/mods/index.php?mod=1675

you're getting that error

The fix is run attached file once (also upload it to the root directory of your site where SSI.php located is the root directory and run it by calling this url http://www.mysite.com/database.php )
Title: Re: Unknown column 'com.time' in 'field list'
Post by: carnaith on June 22, 2009, 04:23:45 PM
sussed it thanks ;D
Title: Re: Unknown column 'com.time' in 'field list'
Post by: ShadoWind on July 04, 2009, 04:28:11 PM
I know this sounds stupid but how do I run the database.php file? I've FTP'ed it to the root folder and made a backup as well but I get a 404 error when I type in the address with the database.php address added to it.
Title: Re: Unknown column 'com.time' in 'field list'
Post by: Arantor on July 04, 2009, 06:24:14 PM
Is Settings.php and SSI.php in that root directory?
Title: Re: Unknown column 'com.time' in 'field list'
Post by: ShadoWind on July 04, 2009, 06:58:42 PM
Yes, they're definitely in the root directory.
Title: Re: Unknown column 'com.time' in 'field list'
Post by: Arantor on July 04, 2009, 07:59:10 PM
What about the permissions for that database.php? Are they the same as SSI.php and Settings.php?

And if your forum is mysite.com/forum/, are you going to mysite.com/forum/database.php ?
Title: Re: Unknown column 'com.time' in 'field list'
Post by: ShadoWind on July 04, 2009, 08:30:33 PM
I checked the setting and it turns out that it's set to 644. I automatically assumed it would switch to 755 when it was copied to the folder.

The link in this case should be asianami.com/forum2/database.php as that's where the forum is located although with the test forum, it would be the same but with the 'forum 2' part replaced by 'test-forum' instead. I'll go and change the setting in the meantime.

EDIT: Tried it again and still no joy as I'm getting an Internal Server Error.

http://www.asianami.com/test-forum/database.php
is the link where the database is located.
Title: Re: Unknown column 'com.time' in 'field list'
Post by: Norv on July 04, 2009, 11:33:05 PM
Can you please check the webserver error logs if you have access to them (in your host's cpanel, perhaps), and post here eventually the errors you may find?
Title: Re: Unknown column 'com.time' in 'field list'
Post by: ShadoWind on July 05, 2009, 06:04:08 AM
I've checked my cPanel and there's no error logs available...
Title: Re: Unknown column 'com.time' in 'field list'
Post by: Norv on July 05, 2009, 06:20:05 AM
Okay, please try in phpMyAdmin then, to run this query:

show columns from smf_profile_comments;

(replace "smf_" with your database prefix).
Title: Re: Unknown column 'com.time' in 'field list'
Post by: ShadoWind on July 05, 2009, 06:30:12 AM
How do I run the query as I've never used phpMyAdmin before.
Title: Re: Unknown column 'com.time' in 'field list'
Post by: Norv on July 05, 2009, 06:32:05 AM
Please check out: Edited: phpMyAdmin (http://www.simplemachines.org/community/index.php?topic=21919.0)
Title: Re: Unknown column 'com.time' in 'field list'
Post by: ShadoWind on July 05, 2009, 06:39:20 AM
What link should I check out? [Thank you for being very helpful! :)]
Title: Re: Unknown column 'com.time' in 'field list'
Post by: Norv on July 05, 2009, 06:43:47 AM
Sorry about that, writing too fast here and I didn't notice copy-paste failed me! :(
Edited the link above.
Title: Re: Unknown column 'com.time' in 'field list'
Post by: ShadoWind on July 05, 2009, 06:46:06 AM
No need to apologise as I do that sort of thing all the time!

EDIT: I think I've found the code needed:

Field Type Null Key Default Extra
ID_COMMENT int(11) NO PRI NULL auto_increment
ID_MEMBER mediumint(8) unsigned NO 0
comment text YES NULL
subject varchar(100) YES NULL
date int(11) NO 0
COMMENT_MEMBER_ID mediumint(8) unsigned NO 0
approved tinyint(4) NO 1

Title: Re: Unknown column 'com.time' in 'field list'
Post by: Norv on July 05, 2009, 06:57:50 AM
Okay, so there is indeed still no "time" column.
Please first, make a backup of the table just in case: select the table smf_profile_comments and use "export" to save it into a file. I think your data is safe if you let the defaults of the export, but make sure you check the "save as file" checkbox, if any.

If the above succeeded, then, afterwards, run also:

ALTER TABLE smf_profile_comments ADD time INT NOT NULL AFTER date;
Title: Re: Unknown column 'com.time' in 'field list'
Post by: ShadoWind on July 05, 2009, 07:16:58 AM
This is what I got:ALTER TABLE smf_profile_comments ADD time INT NOT NULL AFTER date

EDIT: I forgot to mention that it was color coded if that's any help in the top section.
Title: Re: Unknown column 'com.time' in 'field list'
Post by: Norv on July 05, 2009, 07:21:48 AM
It should have said somewhere whether it succeeded (and how many rows were affected), but I suppose it did, since if there was any error messages, those are so ugly and obviously displayed :)
Can you please see if you still have the error with "Unknown column 'com.time' in 'field list'" ?
Title: Re: Unknown column 'com.time' in 'field list'
Post by: ShadoWind on July 05, 2009, 07:27:04 AM
Which one's the field list?

EDIT: You can tell I'm a newbie at PHP! LOL
Title: Re: Unknown column 'com.time' in 'field list'
Post by: Norv on July 05, 2009, 07:31:44 AM
I'm sorry I don't understand the question.
This whole topic is about this error:
Quote from: carnaith on June 22, 2009, 02:33:53 PM
this happens when i click on profile

Unknown column 'com.time' in 'field list'
File: /home/fancya/public_html/Forum/Sources/Profile.php
Line: 1509


Perhaps you can remember when it appeared for you, was it also when clicking "Profile"?
Please try doing that again, and see if the error still appears.
Title: Re: Unknown column 'com.time' in 'field list'
Post by: ShadoWind on July 05, 2009, 07:37:52 AM
I've just clicked on both profiles that are currently available and they seem to work fine now... It was also when clicking 'Profile' and I receive the same error as the one in the opening post.
Title: Re: Unknown column 'com.time' in 'field list'
Post by: Norv on July 05, 2009, 08:44:52 AM
Good to hear it's sorted out then!
Title: Re: Unknown column 'com.time' in 'field list'
Post by: ShadoWind on July 05, 2009, 08:49:04 AM
That's good to know although I still don't know how it was fixed in the first place...
Title: Re: Unknown column 'com.time' in 'field list'
Post by: Norv on July 05, 2009, 10:47:16 AM
Quote from: Norv on July 05, 2009, 06:57:50 AM
If the above succeeded, then, afterwards, run also:

ALTER TABLE smf_profile_comments ADD time INT NOT NULL AFTER date;


This fixed it: the ALTER TABLE statement added a column "time" in the table "smf_profile_comments". The column was missing (and this was the error about)
You said the result was showing you the same statement again, which is normal for phpMyAdmin, but you probably didn't notice that above the statement it must have said a line with "succesful" or something little.
Trust me, if it would have been an error, it would have been a lot of red text. :)
The complains are always more visible :)
Title: Re: Unknown column 'com.time' in 'field list'
Post by: ShadoWind on July 05, 2009, 11:33:44 AM
Quote from: Norv on July 05, 2009, 10:47:16 AM
Quote from: Norv on July 05, 2009, 06:57:50 AM
If the above succeeded, then, afterwards, run also:

ALTER TABLE smf_profile_comments ADD time INT NOT NULL AFTER date;


This fixed it: the ALTER TABLE statement added a column "time" in the table "smf_profile_comments". The column was missing (and this was the error about)
You said the result was showing you the same statement again, which is normal for phpMyAdmin, but you probably didn't notice that above the statement it must have said a line with "succesful" or something little.
Trust me, if it would have been an error, it would have been a lot of red text. :)
The complains are always more visible :)

I see... So if I have this sort of problem again, I just follow the instructions here?

In the meantime, I sincerely want to thank you for your assistance as I would have been pulling my hair out because of this problem...
Title: Re: Unknown column 'com.time' in 'field list'
Post by: Norv on July 05, 2009, 11:43:29 AM
Well, if you need to create this particular column again, sure. I think the column missing is due to some profile-related mod, that needs it but failed to create it, for some reason. If you install the mod on another forum and come to the same error, surely creating manually (or using the file database.php, it would have done the same thing) the missing column is the way to go.