PDA

View Full Version : [Solved] Attachment Permissions error


Stratis
02-16-2017, 03:58 AM
When i press button to see "Attachment Permissions" i get this error:

Database error in vBulletin 4.2.0:

Invalid SQL:

SELECT usergroupid, extension, attachmentpermissionid
FROM attachmentpermission AS attachmentpermission;

MySQL Error : Table 'MY DATABASE.attachmentpermission' doesn't exist
Error Number : 1146
Script : http://MY DOMAIN/admincp/attachmentpermission.php
Referrer : https://MY DOMAIN/admincp/index.php?do=nav
Classname : vB_Database_MySQLi
MySQL Version : 5.5.54-MariaDBFile, "admincp/attachmentpermission.php" is in ftp as supposed to be.
I am sure that it worked before 5-6 months. Any help please to fix this problem.

Thanks

MarkFL
02-16-2017, 04:14 AM
Does that table have a prefix that's different than what you have specified in your config.php file?

Stratis
02-16-2017, 04:27 AM
Does that table have a prefix that's different than what you have specified in your config.php file?
Thanks Mark for the answer, but i do not understand what you ask.

Just now i test and the Attachment Manager, canot create new extention and not edit an excisting, when i press save i get an error here to.

Database error in vBulletin 4.2.0:

Invalid SQL:

SELECT
atype.extension, atype.height AS default_height, atype.width AS default_width, atype.size AS default_size, atype.contenttypes,
aperm.height AS custom_height, aperm.width AS custom_width, aperm.size AS custom_size,
aperm.attachmentpermissions AS custom_permissions, aperm.usergroupid
FROM attachmenttype AS atype
LEFT JOIN attachmentpermission AS aperm USING (extension)
ORDER BY extension;

MySQL Error : Table 'MY DATABASE.attachmentpermission' doesn't exist
Error Number : 1146
Script : http://MY DOMAIN/admincp/attachment.php?do=doupdatetype
Referrer : https://MY DOMAIN/admincp/attachment.php?do=updatetype



I did not change any thing about prefixes or what else, thank you.

MarkFL
02-16-2017, 04:34 AM
It appears to me that the constant "TABLE_PREFIX" used in vB queries in PHP code (and determined by the value given in your config.php file) is not the same as the prefix for that table, either that or the table has been dropped from the db.

Check your database to make sure the table is there...:)

Stratis
02-16-2017, 04:43 AM
I cannot check this right now from my work. I will see it after 7 hours, But i do not understand what to search, i just see some tittles you wrote here :) so will go with this.


In my test forum it is ok, test forum is a copy from my live forum, that means something happened after that.


If something missing from database? can this be fixed some how?

MarkFL
02-16-2017, 05:02 AM
I generally use phpMyAdmin to investigate database issues. First check to see if the table in question is there. :)

Stratis
02-16-2017, 05:43 AM
First check to see if the table in question is there. :)
Sorry but do not understand, find this? because do not now what and where exactly search for?

I looked though in my databases,
1) Test forum - "attachmentpermission" is present.
155818


2) Live forum - "attachmentpermission" is missing
155817

Is this something to start with?

MarkFL
02-16-2017, 06:11 AM
Yes, that's what's causing the db error, that table appears to be missing. :(

Stratis
02-16-2017, 06:30 AM
I made these steps:

1) i export "attachmentpermission" as sql from my test forum that had this table.
2) i changed the database name in the sql file with the live forum database name.
3) i inport this sql file in database of live forum.

Now there where i had errors work fine.
I want to know if this i done is ok and safe for all forum (database tables or whatwever)?

Thanks for focusing help.