MyBB Community Forums

Full Version: SMF 2.0 to MyBB: "1054 - Unknown column 'id_msg' in 'where clause'"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello! 

I am trying to test a SMF 2.0 to MyBB merge on a subdomain currently and I am getting this error currently when trying to covert threads over:
MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1054 - Unknown column 'id_msg' in 'where clause'
Query:
SELECT COUNT(*) as numattachments FROM PREFIX_attachments WHERE id_msg IN(1, 191, 196)

I am also getting the same error when trying to import settings + avatars.
SQL Error:
1054 - Unknown column 'variable' in 'where clause'
Query:
SELECT COUNT(*) as count FROM PREFIX_settings WHERE variable IN('karmaMode','enableCompressedOutput','attachmentNumPerPostLimit','attachmentThumbnails','attachmentThumbWidth','attachmentThumbHeight','enableErrorLogging','cal_enabled','smtp_host','smtp_port','smtp_username','smtp_password','mail_type','hotTopicPosts','registration_method','spamWaitTime','reserveNames','avatar_max_height_upload','avatar_max_width_upload','failed_login_threshold','edit_disable_time','max_messageLength','max_signatureLength','defaultMaxTopics','defaultMaxMembers','time_offset')
SQL Error:
1054 - Unknown column 'a.id_attach' in 'field list'
Query:
SELECT u.id_member, u.avatar, a.id_attach, a.filename, a.file_hash, a.width, a.height FROM smfbb_members u LEFT JOIN PREFIX_attachments a ON (a.id_member=u.id_member AND id_msg=0) WHERE u.avatar != '' OR a.id_attach IS NOT NULL


I have already deleted the install folder as prompted per the installer page, but these error instructions say to downgrade MyBB. I think doing this may be an issue, so I am holding off.

Any ideas on what to do?

Edit:
Just restored my database from the backup and tried again with the Github update. No change.
Update:

With help from here, I got the first two working. The third, references avatars, does not work.

The last one "1054 - Unknown column 'a.id_attach' in 'field list'" is not letting me create a column because it has a period within it. I can create 'id_attach' but not "a.id_attach.' Should I push through the process with quotes or do something else? It's also listing two databases, _attachments and _members.

Using this command:
ALTER TABLE smfbb_members
ADD COLUMN a.id_attach INT NOT NULL;

What now?
(2024-01-09, 01:02 AM)StarredSkies Wrote: [ -> ]It's also listing two databases, _attachments and _members.

Create the id_attach column in the attachments table.


Laird Wrote:a. represents the table alias in a query followed by a dot as a separator. When creating the column id_attach, remove the a. from it, because it's not part of the column's name, but is only valid in the context of the query in which it occurred.

(In fact, it needn't be a table alias, but could be the actual table name, but I'm assuming you don't actually have a table named a!)
Yeppers! I meant to post here but I must have forgotten. I do apologize.

Thank you for your help, Omar.