error SELECT
SQL_CALC_FOUND_ROWS DISTINCT
u.uid,
s.pid,
s.title,
s.his_name,
s.her_name,
s.his_year,
s.her_year,
s.his_month,
s.her_month,
s.icon,
s.photo_count,
t.id as town_id,
t.name as town_name,
t.postcode,
c.id as county_id,
c.name as county_name,
country.id as country_id,
country.name as country_name,
country.suffix as country_suffix,
u.ls_join,
u.town_id,
u.confirmed_f,
u.verified,
u.class,
u.members_only,
u.last_login,
UNIX_TIMESTAMP(u.date_expires) AS date_expires
FROM
search AS s,
wt_users AS u,
town as t,
county as c,
country
, postcodes AS p
WHERE
s.uid=u.uid AND
u.town_id=t.id AND
t.FK_county_id=c.id AND
c.FK_country_id=country.id AND
t.postcode=p.outcode AND
u.online='Y' AND
u.active='Y'
AND ((p.x > -80000 AND p.x < 80000) AND
(p.y > -80000 AND p.y < 80000))
AND ((u.ls_join=2 AND u.class=1) OR
(u.ls_join=2 AND u.confirmed_f='Y') OR
(u.ls_join != 2))
ORDER BY u.last_login DESC LIMIT -8, 8