This is the SQL error:
Error: 1064 - 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 (pi.perm_type='forum' and ( pi.perm_2='*' OR pi.perm_2 LIKE '%,4,%' )) and' at line 2
This is the SQL query:
SELECT t.tid AS id, t.title, t.last_poster_id AS id2,m.member_group_id,
m.members_display_name AS statistic,pi.perm_2 FROM topics t LEFT JOIN members m ON (
m.member_id = t.last_poster_id )
LEFT JOIN permission_index pi ON ( pi.app='forums' AND pi.perm_type='forum' AND
pi.perm_type_id=t.forum_id ) WHERE t.forum_id NOT IN() AND (pi.perm_type='forum' AND (
pi.perm_2='*' OR pi.perm_2 LIKE '%,4,%' )) AND t.approved=1 AND (t.moved_to='' OR
t.moved_to IS NULL ) ORDER BY t.last_post DESC LIMIT 0,11
Now, this query runs fine on my MySQL local installation (XAMPP).
Could it be that different MySQL versions would cause the SQL error in this query? And what is causing the error exactly?
-
The “LIKE” operator?
-
The nested statement in the where clause? ( Between the () )
-
Something else?
Thanks in advance!
You have an empty NOT IN
Also, you don’t need one of the WHERE conditions on pi because it is in the LEFT JOIN. However, the LIKE filter in the WHERE on the outer table pi changes this to an inner join.
So, you’ll need this and fix your IN
Much easier when you pay attention to formatting, eh?