Query
select b1.id as bookid, b1.name as bookname, b.name as chaptername, count(c.id) as commentscount, p.*, substring(p.text,1,500) as title from icp_posts p left join icp_comments c on p.id=c.ideaid left join icp_books b on p.chapter=b.id left join icp_books b1 on b.parent=b1.id where p.userid in (944) and  1  and p.privacylevel in (0) and  1  and  1  and  1  and  1  and  1  and  1  and  1  and  1  and  1  and  1  and  1  and  1 and  1  group by p.id order by datemodified desc, datecreated desc, book, chapter LIMIT 275, 25caused error: Lost connection to MySQL server during query