i have two date select tag like:in view
<%= date_select:date1,:order=>[:year,:month,:date] %>
<%= date_select:date2,:order=>[:year,:month,:date] %>
and in controller i write
@infos = Info.find(:all, :conditions => ["dt between ? and ?",
params[:date1], params[:date2]])
but the query can;t execute.the error is
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
''''--- \n-
orderyearmonthdate(2i)\n- \"3\"\n'',''--- \n-
orderyearmonthdate(3i)\n- \''
at line 1: SELECT * FROM `infos` WHERE (dt between ''--- \n-
orderyearmonthdate(1i)\n- \"2008\"\n'',''--- \n-
orderyearmonthdate(2i)\n-
\"3\"\n'',''--- \n- orderyearmonthdate(3i)\n-
\"16\"\n'' and ''--- \n-
orderyearmonthdate(1i)\n- \"2008\"\n'',''--- \n-
orderyearmonthdate(2i)\n-
\"3\"\n'',''--- \n- orderyearmonthdate(3i)\n-
\"16\"\n'')
what should i do?
please help..very urgent..
please provide :simple code::
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---