No results recorded for this division.

Error in query: SELECT t.id, tname AS Team, SUM(P) AS P, SUM(W1) AS W, SUM(D1) AS D, SUM(L1) AS L, SUM(NR) AS NR, SUM(F) as F, SUM(A) AS A, SUM(SD) AS SD, SUM(BP) AS BP, SUM(ADJ) AS ADJ, SUM(PTS1)+SUM(BP)+SUM(ADJ) AS TOTAL, (((SUM(PTS1)+SUM(BP)+SUM(ADJ))*1000)+SUM((W1)*100)+SUM(SD*10)+SUM((F/P)*1)) AS Rank FROM( SELECT comp_id Comp, hteam_id Team, 1 P, CASE WHEN (adjusted<>'Y') THEN IF (hscore1 > ascore1,1,0) ELSE 0 END W1, CASE WHEN (adjusted<>'Y') THEN IF (hscore1 = ascore1,1,0) ELSE 0 END D1, CASE WHEN (adjusted<>'Y') THEN IF (hscore1 < ascore1,1,0) ELSE 0 END L1, CASE WHEN (adjusted='Y') THEN 1 ELSE 0 END NR, CASE WHEN (adjusted<>'Y') THEN hscore1 ELSE 0 END F, CASE WHEN (adjusted<>'Y') THEN ascore1 ELSE 0 END A, CASE WHEN (adjusted<>'Y') THEN hscore1 - ascore1 ELSE 0 END SD, CASE WHEN (adjusted<>'Y') THEN hbonus ELSE 0 END BP, CASE WHEN (adjusted='Y') THEN hadjust ELSE 0 END ADJ, CASE WHEN (adjusted<>'Y') AND hscore1 > ascore1 THEN 2 WHEN (adjusted<>'Y') AND hscore1 = ascore1 THEN 1 ELSE 0 END PTS1, FROM fixtures WHERE (comp_id = '') AND played = 'Y' UNION ALL SELECT comp_id, ateam_id, 1, CASE WHEN (adjusted<>'Y') THEN IF (hscore1 < ascore1,1,0) ELSE 0 END, CASE WHEN (adjusted<>'Y') THEN IF (hscore1 = ascore1,1,0) ELSE 0 END, CASE WHEN (adjusted<>'Y') THEN IF (hscore1 > ascore1,1,0) ELSE 0 END, CASE WHEN (adjusted='Y') THEN 1 ELSE 0 END, CASE WHEN (adjusted<>'Y') THEN ascore1 ELSE 0 END, CASE WHEN (adjusted<>'Y') THEN hscore1 ELSE 0 END, CASE WHEN (adjusted<>'Y') THEN ascore1 - hscore1 ELSE 0 END, CASE WHEN (adjusted<>'Y') AND abonus ELSE 0 END, CASE WHEN (adjusted='Y') THEN aadjust ELSE 0 END, CASE WHEN (adjusted<>'Y') AND hscore1 < ascore1 THEN 2 WHEN (adjusted<>'Y') AND hscore1 = ascore1 THEN 1 ELSE 0 END, FROM fixtures WHERE (comp_id = '') AND (played = 'Y') ) as tot JOIN teams t ON tot.Team=t.id GROUP BY Team ORDER BY Rank DESC. 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 'FROM fixtures WHERE (comp_id = '') AND played = 'Y' UNION ALL SELECT comp' at line 31