just a question: is good or bad only determined by the number of replies?
Also when you are not using an exclude (thread or forum) you are still using it in the where clause. This make the query perform less good. I suggest you only include those in the where if you are excluding something.
I would also suggest you prefix all the used Phraseid's and Varnames, for example with the productid, so there can be no problems with other hacks or future vB versions for using the same names.
just a question: is good or bad only determined by the number of replies?
__________________________________________________ ___________
i think it's good and this hack requested in vbh.com with just hack of the day ordered by replies only
Also when you are not using an exclude (thread or forum) you are still using it in the where clause. This make the query perform less good. I suggest you only include those in the where if you are excluding something.
__________________________________________________ ___________
i think this is the best way :surprised:
I would also suggest you prefix all the used Phraseid's and Varnames, for example with the productid, so there can be no problems with other hacks or future vB versions for using the same names.
__________________________________________________ ___________
ok i'll keep this in mind and now i am putting such a codes like devel,developer,first letter hack name like this hack i used bwt (best&worst thread)
SELECT thread.postusername,
thread.postuserid,
thread.title AS fth,
thread.lastposter,
thread.replycount,
thread.views,
thread.threadid,
thread.forumid tid,
forum.forumid AS fid,
forum.title AS ft
FROM vb3_thread, forum
WHERE forum.forumid = thread.forumid
AND dateline BETWEEN 1139591779 AND 1139764579
AND thread.forumid NOT IN (0)
AND thread.threadid NOT IN (0)
ORDER BY thread.replycount DESC LIMIT 1;
MySQL Error : Table '******_*****.forum' doesn't exist
Error Number : 1146
Date : Saturday, February 11th 2006 @ 12:16:19 PM
SELECT thread.postusername,
thread.postuserid,
thread.title AS fth,
thread.lastposter,
thread.replycount,
thread.views,
thread.threadid,
thread.forumid tid,
forum.forumid AS fid,
forum.title AS ft
FROM BlizzedOut_thread, forum
WHERE forum.forumid = thread.forumid
AND dateline BETWEEN 1139613221 AND 1139786021
AND thread.forumid NOT IN ()
AND thread.threadid NOT IN ()
ORDER BY thread.replycount DESC LIMIT 1;
MySQL Error : You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ')
AND thread.threadid NOT IN ()
ORD
Error Number : 1064
Date : Saturday, February 11th 2006 @ 06:13:42 PM
Script : http://www.BeastToast.com/forums/index.php?
Referrer :
IP Address : *.*.*.*
Username : Chad
Classname : vb_database
[/sql]