Welcome Guest | Login

hi, kind of stuck on this mysql syntax....it works on my local mysql.


@friend_ids = "1,2,3"


@friend_blogs = BlogPost.find(:all, :order => "created_at DESC", :conditions => "user_id IN (#{@friend_ids})").first(8)

ActiveRecord::StatementInvalid (Mysql::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 created_at DESC' at line 1: SELECT * FROM blog_posts WHERE (user_id IN '')  ORDER BY created_at DESC):


thanks!

2007-11-21 06:51 PM

nj rails grunt!
Could you try repairing the database from your cPanel control panel?
What version MySQL are using on your local computer ?


2007-11-21 07:41 PM

Why does your @friend_ids is nil or empty ?

2007-11-29 04:16 AM


Hello Guest! In order to post you must be an active client with us, please log in or sign up today!