Deadlock found when trying to get lock; try restarting transactionSELECT image , testo_de as testo, titolo_de as titolo ,
link_pagina , icon, link_libero_de 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_de)
FROM strutturapagine WHERE id = headers.link_pagina) as permalink ,
(SELECT titolo_de FROM strutturapagine WHERE id = headers.link_pagina) as titolopagina
FROM headers WHERE attivo = 'on' AND pagine LIKE '%,xxx,%' ORDER BY ordine DESC LIMIT 5