作业帮 > 英语 > 作业

ruby 例如 :conditions => ["name = and product_id = "]

来源:学生作业帮 编辑:百度作业网作业帮 分类:英语作业 时间:2024/04/29 12:54:56
ruby 例如 :conditions => ["name = and product_id = "]
ruby 例如 :conditions => [
这个就相当于 是 sql的 条件语句啊
上面的 就相当于 where name = and product_id=
这里的问号 就相当于 sql语句的预处理
:conditions => ["name = and product_id = "]
这个应该 是需要给两个预处理参数
:conditions => ["name = and product_id = ",params[:name],params[:product_id]]
正常的语句 是 select * from product where name =params[:name] and product_id= params[:product_id]