A Database Error Occurred
Error Number: 1064
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 totalvotes desc LIMIT 3' at line 7
SELECT recipes.*, user_profile.user_id, user_profile.bio_image_thumb, recipe_types.desc as rtype, recipe_types.id as type, (SELECT fa_user.user_name from fa_user where fa_user.id = recipes.user_id) as user_name, (SELECT count(*) from comments where parent_id = recipes.id AND parent_type = 'recipe') as totalcomments, (SELECT count(vote_recipes.item_id) from vote_recipes where vote_recipes.item_id = recipes.id) as totalvotes FROM (recipes) JOIN user_profile ON user_profile.user_id = recipes.user_id JOIN recipe_types ON recipes.type = recipe_types.id WHERE `type` IS NULL AND `recipes`.`id` != ORDER BY totalvotes desc LIMIT 3