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