select *,
(
CASE
WHEN (CURDATE() between sconto_inizio and sconto_fine) and giacenza > 0 THEN prezzoweb-((prezzoweb/100)*sconto_percent)
ELSE prezzoweb
END) AS scontato from titoli_home WHERE MATCH ( autore )
AGAINST ('+capo+archie+fire+lame+deer+helene+sarkis+' IN BOOLEAN MODE) and visibile = 1 ORDER BY titolo ASC
syntax error, unexpected $end