Skip to content

Commit

Permalink
Fix SQL syntax for user profile thanks lists.
Browse files Browse the repository at this point in the history
  • Loading branch information
rxu committed Oct 8, 2023
1 parent 13216d0 commit 6e331c8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,10 @@ public function output_thanks_memberlist($user_id, $ex_fid_ary)
'SELECT' => 't.user_id, t.post_id, u.username, u.user_colour',
'FROM' => [$this->thanks_table => 't', $this->users_table => 'u'],
'WHERE' => 't.poster_id =' . (int) $user_id .' AND u.user_id = t.user_id AND (' . $this->db->sql_in_set('t.forum_id', $ex_fid_ary, true) . ' OR t.forum_id = 0)',
'ORDER_BY' => 't.post_id DESC LIMIT ' . $poster_limit,
'ORDER_BY' => 't.post_id DESC',
];
$sql = $this->db->sql_build_query('SELECT', $sql_array);
$result = $this->db->sql_query($sql);
$result = $this->db->sql_query_limit($sql, $poster_limit, 0);

while ($row = $this->db->sql_fetchrow($result))
{
Expand Down Expand Up @@ -491,10 +491,10 @@ public function output_thanks_memberlist($user_id, $ex_fid_ary)
'SELECT' => 't.poster_id, t.post_id, u.username, u.user_colour',
'FROM' => [$this->thanks_table => 't', $this->users_table => 'u'],
'WHERE' => 't.user_id =' . (int) $user_id . ' AND u.user_id = t.poster_id AND (' . $this->db->sql_in_set('t.forum_id', $ex_fid_ary, true) . ' OR t.forum_id = 0)',
'ORDER_BY' => 't.post_id DESC LIMIT ' . (int) $poster_limit,
'ORDER_BY' => 't.post_id DESC' ,
];
$sql = $this->db->sql_build_query('SELECT', $sql_array);
$result = $this->db->sql_query($sql);
$result = $this->db->sql_query_limit($sql, $poster_limit, 0);

while ($row = $this->db->sql_fetchrow($result))
{
Expand Down

0 comments on commit 6e331c8

Please sign in to comment.