no valid array givenQuery SELECT t.tag_name FROM blog_posts_to_tags bpt, tags t WHERE bpt.tag_id = t.id AND bpt.blog_post_id = ORDER BY t.tag_name failed with error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY t.tag_name' at line 5