My "Start update thread count" section in "functions.php"
compares ok with the original "functions.php":
*******************************
PHP Code:
function updatethreadcount($threadid) {
global $DB_site,$threadcache;
$replies=$DB_site->query_first("SELECT COUNT(*)-1 AS replies, SUM(attachment.visible) AS attachsum
FROM post
LEFT JOIN attachment ON attachment.attachmentid=post.attachmentid
WHERE threadid='$threadid'");
$lastposts=$DB_site->query_first("SELECT user.username,post.username AS postuser,post.dateline
FROM post
LEFT JOIN user ON user.userid=post.userid
WHERE post.threadid='$threadid' AND visible>0
ORDER BY dateline DESC
LIMIT 1");
$lastposter=iif($lastposts['username']=="",$lastposts['postuser'],$lastposts['username']);
$lastposttime=$lastposts['dateline'];
$firstposts=$DB_site->query_first("SELECT post.userid,user.username,post.username AS postuser,post.dateline
FROM post
LEFT JOIN user ON user.userid=post.userid
WHERE post.threadid='$threadid' AND visible>0
ORDER BY dateline
LIMIT 1");
$firstposter=iif($firstposts['username']=="",$firstposts['postuser'],$firstposts['username']);
$firstposterid=$firstposts['userid'];
$DB_site->query("UPDATE thread SET postusername='".addslashes($firstposter)."',postuserid='$firstposterid',lastpost='$lastposttime',replycount='$replies[replies]',attach='$replies[attachsum]', lastposter='".addslashes($lastposter)."' WHERE threadid='$threadid'");
}
**************************
Does that mean that it is in the mySQL the problem is?