MyBB Community Forums

Full Version: mySQL error: 1146 [when doing regular attachment search]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi.
I am on RC4.
From admin panel if i try a simple search for attachments I get this error:

mySQL error: 1146
Table 'mybb.threads' doesn't exist
Query: SELECT a.*, p.tid, p.fid, t.subject, f.name, u.uid, u.username FROM mybb_attachments a LEFT JOIN mybb_posts p ON (p.pid=a.pid) LEFT JOIN threads t ON (t.tid=p.tid) LEFT JOIN forums f ON (p.fid=f.fid) LEFT JOIN users u ON (p.uid=u.uid) WHERE p.fid='3' AND a.filesize > '3072' ORDER BY a.filename


Any hope to fix this?
Thanks a lot!
It would be helpful if you could upgrade to 1.02 first, since I have a strong feeling the bug will already have been fixed.
1-find line of sql execution
2-add this section before "threads" on the sql part.
LEFT JOIN threads ==>replace to =>> LEFT JOIN ".table_prefix."threads



why you dont upgrade?
Is that a SQL Query that I should run from admin panel or is that a function I should run from phpMyAdmin?
I just couldn't understand what "find line of sql execution" means.
Sorry, I am not very strong in MySQL.
he means the php file!!
find the line corresponding to the query and edit it as he mentioned.

regards
I guess you mean the attachments.php from admin directory.
I have done as said, and here is the next error i get during search:

mySQL error: 1146
Table 'mybb.table_prefixthreads' doesn't exist
Query: SELECT a.*, p.tid, p.fid, t.subject, f.name, u.uid, u.username FROM mybb_attachments a LEFT JOIN mybb_posts p ON (p.pid=a.pid) LEFT JOIN table_prefixthreads t ON (t.tid=p.tid) LEFT JOIN forums f ON (p.fid=f.fid) LEFT JOIN users u ON (p.uid=u.uid) WHERE p.fid='3' ORDER BY a.filename
look here >>> table_prefixthreads it should be ".table_prefix."threads.

regards
zaher1988 Wrote:look here >>> table_prefixthreads it should be ".table_prefix."threads.

regards
I am sure something is wrong because i did everything right.
Here is the attachments.php it uses at present time:
[attachment=2105]
Check it and you will see that i've done all ok.
what;s the error ur getting now after all these fixes ??

coz we can't search the whole php file, and also no one has RC4 to test it.

regards
I get this error:

mySQL error: 1146
Table 'mybb.table_prefixthreads' doesn't exist
Query: SELECT a.*, p.tid, p.fid, t.subject, f.name, u.uid, u.username FROM mybb_attachments a LEFT JOIN mybb_posts p ON (p.pid=a.pid) LEFT JOIN table_prefixthreads t ON (t.tid=p.tid) LEFT JOIN forums f ON (p.fid=f.fid) LEFT JOIN users u ON (p.uid=u.uid) WHERE p.fid='3' ORDER BY a.filename
Pages: 1 2