Deadlock found when trying to get lock; try restarting transactionSELECT image , testo_en as testo, titolo_en as titolo ,
link_pagina , icon, link_libero_en as link_libero , newtab ,
(SELECT
IF((SELECT id FROM strutturapagine WHERE attivo = 'on' AND sottopagina_di = '' ORDER BY ordine DESC LIMIT 1) = headers.link_pagina , '' , permalink_en)
FROM strutturapagine WHERE id = headers.link_pagina) as permalink ,
(SELECT titolo_en FROM strutturapagine WHERE id = headers.link_pagina) as titolopagina
FROM headers WHERE attivo = 'on' AND pagine LIKE '%,24,%' ORDER BY ordine DESC LIMIT 5