1046 - No database selected

select l.languages_id, l.name, l.code, l.image, l.directory from languages l, languages_to_websites lw where l.languages_id = lw.languages_id and lw.on_public = '1' and websites_id = '1' order by lw.sort_order

[SQL BUG]