Loading...
 
Skip to main content

Features / Usability


You are viewing a reply to SQL error when reading a post in a forum.

UPDATED: SQL error when reading a post in a forum.

I edited the file ./lib/commentslib.php

I changed

tc2.`in_reply_to` = \"\"
to
tc2.`in_reply_to` = not null

I realize that not null and "" hold two different values. Hopefully there aren't any repercussions.

-----------------------------------

$query = "select tc1.`threadId`, tc1.`object`, tc1.`objectType`, tc1.`parentId`, tc1.`userName`, tc1.`commentDate`, tc1.`hits`, tc1.`type`, tc1.`points`, tc1.`votes`, tc1.`average`, tc1.`title`, tc1.`data`, tc1.`hash`, tc1.`user_ip`, tc1.`summary`, tc1.`smiley`, tc1.`message_id`, tc1.`in_reply_to`, tc1.`comment_rating` from `tiki_comments` as tc1
left outer join `tiki_comments` as tc2 on tc1.`in_reply_to` = tc2.`message_id`
$mid
and (tc1.`in_reply_to` = ?
or (tc2.`in_reply_to` = not null or tc2.`in_reply_to` is null or tc2.message_id is null or tc2.parentid = 0))