Failed to select database
SELECT * FROM pages WHERE disabled<1 and parent=0 ORDER BY ordr LIMIT 1

SELECT * FROM setup

SELECT * FROM pages WHERE id=1 and disabled<1 ORDER BY ordr

SELECT gadgets.filename,gadgets.parameter1,gadgets.parameter2 FROM page_gadgets LEFT JOIN gadgets ON page_gadgets.gadget = gadgets.id WHERE pageid=1 and position=0 ORDER BY page_gadgets.id

SELECT gadgets.filename,gadgets.parameter1,gadgets.parameter2 FROM page_gadgets LEFT JOIN gadgets ON page_gadgets.gadget = gadgets.id WHERE pageid=1 and position=1 ORDER BY page_gadgets.id

SELECT gadgets.filename,gadgets.parameter1,gadgets.parameter2 FROM page_gadgets LEFT JOIN gadgets ON page_gadgets.gadget = gadgets.id WHERE pageid=1 and position=2 ORDER BY page_gadgets.id