I googled this Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column
and found the instruction
https://dev.mysql.com/doc/refman/5.7/en ... dling.html
and I changed helper.php to these:-
$sql = 'SELECT min(p.post_id), min(p.topic_id), min(p.forum_id), min(p.post_text), min(p.post_subject), p.post_time, min(t.topic_id), min(t.topic_title)
FROM ' . POSTS_TABLE . ' p
LEFT JOIN ' . TOPICS_TABLE . ' t ON t.topic_id = p.topic_id
WHERE post_text '. $this->db->sql_like_expression($this->db->get_any_char() . $chars . $this->db->get_any_char()) . '
' . $sql_where . '
' . $sql_where_forbidden . '
' . $sql_where_topic . '
' . $sql_forum . '
AND p.post_visibility = 1
AND p.post_id = t.topic_first_post_id
ORDER BY p.post_time DESC';
$sql = 'SELECT min(a.attach_id), a.post_msg_id, min(a.physical_filename), min(a.real_filename), min(a.extension), min(a.filetime), min(t.topic_title)
FROM ' . ATTACHMENTS_TABLE . ' a, ' . FORUMS_TABLE . ' f, ' . TOPICS_TABLE . ' t
' . $sql_where . '
AND (mimetype = "image/jpeg" OR mimetype = "image/png" OR mimetype = "image/gif")
AND a.topic_id = t.topic_id
AND t.topic_first_post_id = a.post_msg_id
GROUP BY a.post_msg_id DESC';
$sql = 'SELECT min(post_id), min(post_text), post_time
FROM ' . POSTS_TABLE . ' p
WHERE post_text '. $this->db->sql_like_expression($this->db->get_any_char() . $chars . $this->db->get_any_char()) . '
AND post_visibility = 1
GROUP BY post_time
ORDER BY post_time DESC';
$sql = 'SELECT min(a.attach_id), a.post_msg_id, min(a.extension), min(p.post_id), min(p.topic_id), min(p.post_time), min(p.post_visibility)
FROM ' . ATTACHMENTS_TABLE . ' a, ' . POSTS_TABLE . ' p
WHERE a.post_msg_id = p.post_id
AND (mimetype = "image/jpeg" OR mimetype = "image/png" OR mimetype = "image/gif")
AND p.post_visibility = 1
GROUP BY a.post_msg_id DESC';
and listener.php to these
$sql = 'SELECT p.post_id, min(p.topic_id), min(p.forum_id), min(p.post_text), min(t.topic_id), min(t.topic_title)
FROM ' . POSTS_TABLE . ' p
LEFT JOIN ' . TOPICS_TABLE . ' t ON t.topic_id = p.topic_id
WHERE post_text '. $this->db->sql_like_expression($this->db->get_any_char() . $chars . $this->db->get_any_char()) . '
AND t.topic_id = '. $tid . '
' . $sql_were . '
' . $sql_were_topic . '
GROUP BY p.post_id
ORDER BY p.post_id ASC';
$sql = 'SELECT min(physical_filename), min(extension), topic_id, min(post_msg_id)
FROM ' . ATTACHMENTS_TABLE . '
WHERE (mimetype = "image/jpeg" OR mimetype = "image/png" OR mimetype = "image/gif")
AND ' . $this->db->sql_in_set('topic_id', $topic_ids) . '
GROUP BY topic_id
ORDER BY min(post_msg_id) ASC';
and the General Error SQL ERROR [ mysqli ] goes away
But what i get is only a no-photo.png on page 2 only.
Anybody has any idea?