Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: wynnyelle - syyskuu 07, 2013, 03:48:08 IP

Otsikko: Members getting database error when they try to go to tag search
Kirjoitti: wynnyelle - syyskuu 07, 2013, 03:48:08 IP
This started like 2 or 3 days ago. I'm getting many complaints from members that they cannot access our tag search. They just get a database goof.


Apply Filter: Only show the error messages of this member softhard
Apply Filter: Only show the error messages of this IP address 174.76.119.212 
  Reverse chronological order of list Today at 02:38:31 PM
Apply Filter: Only show the error messages of this session 41266e3c473f0c1a515765f54ed9c106
Apply Filter: Only show the errors of this type Type of error: Database
Apply Filter: Only show the error messages of this URL
http://warriorcatsrpg.com/index.php?action=tags
Apply Filter: Only show the errors with the same message
Database Goof: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND tags_log.id_content = 0(FIND_IN_SET(0, b.member_groups) != 0 OR FIND_IN_SET(' at line 38


SELECT
DISTINCT(t.id_topic), t.id_board, t.num_replies, t.is_hidden, t.is_private, t.invited_users,
f_msg.subject, f_msg.id_msg AS f_msg_id,
f_mem.real_name AS f_msg_poster, f_msg.id_member AS f_msg_member_id,
f_msg.icon AS f_msg_icon, l_msg.id_msg AS l_msg_id, l_mem.real_name AS l_msg_poster,
l_msg.id_member AS l_msg_member_id, l_msg.id_msg_modified AS l_msg_modified,
IF (l_msg.modified_time > 0, l_msg.modified_time, l_msg.poster_time) AS last_updated,
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1 AS new_from

FROM smf_topics AS t

INNER JOIN smf_boards as b
ON b.id_board = t.id_board

INNER JOIN smf_tags_log AS tags_log
ON tags_log.id_topic = t.id_topic

INNER JOIN smf_messages AS l_msg
ON l_msg.id_msg = t.id_last_msg

INNER JOIN smf_messages AS f_msg
ON f_msg.id_msg = t.id_first_msg

INNER JOIN smf_members AS f_mem
ON f_mem.id_member = t.id_member_started

INNER JOIN smf_members AS l_mem
ON l_mem.id_member = l_msg.id_member


LEFT JOIN smf_log_topics AS lt
ON (lt.id_topic = t.id_topic AND lt.id_member = 146257)

LEFT JOIN smf_log_mark_read AS lmr
ON (lmr.id_board = t.id_board AND lmr.id_member = 146257)

WHERE
AND tags_log.id_content = 0(FIND_IN_SET(0, b.member_groups) != 0 OR FIND_IN_SET(42, b.member_groups) != 0)

ORDER BY f_msg.id_msg DESC
LIMIT 0, 25
Apply Filter: Only show the errors from this file
File: /home/warrior/public_html/Sources/Tags2.php
Line: 658


My error log is filled with these. What do I do?
Otsikko: Re: Members getting database error when they try to go to tag search
Kirjoitti: live627 - syyskuu 07, 2013, 04:15:06 IP
Attach the file indicated.
Otsikko: Re: Members getting database error when they try to go to tag search
Kirjoitti: margarett - syyskuu 07, 2013, 10:33:37 IP
And what MOD is that? You should probably ask in it's support topic, though...

But actually it seems to be a MYSQL error here...

AND tags_log.id_content = 0(FIND_IN_SET(0, b.member_groups) != 0 OR FIND_IN_SET(42, b.member_groups) != 0)

There is no operator before the first "(FIND_IN_SET". It seems that it shoud be an "AND". But not sure

AND tags_log.id_content = 0 AND (FIND_IN_SET(0, b.member_groups) != 0 OR FIND_IN_SET(42, b.member_groups) != 0)

Otsikko: Re: Members getting database error when they try to go to tag search
Kirjoitti: wynnyelle - syyskuu 07, 2013, 11:17:20 IP
i am not sure what file it is in. I will ask tomorrow when Emanuele, the amazing programmer, is on. :)
Otsikko: Re: Members getting database error when they try to go to tag search
Kirjoitti: margarett - syyskuu 07, 2013, 11:22:20 IP
It's identified in that error log... Sources/Tags2.php, line 658!
Otsikko: Re: Members getting database error when they try to go to tag search
Kirjoitti: wynnyelle - syyskuu 08, 2013, 09:17:44 IP
I tried to fix it and now it is line 183 the error.
Otsikko: Re: Members getting database error when they try to go to tag search
Kirjoitti: Arantor - syyskuu 08, 2013, 09:19:10 IP
And now you've made another topic, awesome.