谁知道用ci怎么写关于between and的sql语句?
:)大家好~ 请问谁知道ci里的between and 是怎么写的~就像就平均的话是select_avg(),那bentween and 的写法是什么?
例如 select prod_name,prod_price from products where prod_price between 5 and 10;
请各位高手指教~ 额,你就直接写sql语句就好了呀,写完了,用$this->db->query($sql)
或者用$this->db->where('prod_price between 5 and 10'); 回复 2# ywqbestever
恩~ 谢谢你啊~ 不过betwenn and 有没有类似select_num()的做法啊~ 没有 没有吧,这里面没有,就应该没有的。
system/database/DB_active_rec.php 回复 4# visvoy
哦~谢谢你啊~:loveliness: 回复 5# uroko
恩 ~ 我在网上找了很做资料也没有~呵呵 看来真的没有了~ select prod_name,prod_price from products where prod_price between 5 and 1;
$this->db->select('prod_name,prod_price');
$this->db->where('prod_price between 5 and 1');
$this->db->get('products');
目前也只能用这个方法了~ ci小新 发表于 2010-4-13 17:59 static/image/common/back.gif
select prod_name,prod_price from products where prod_price between 5 and 1;
$this->db->select('prod_ ...
谢谢了。正需要。 本帖最后由 寄语残云 于 2017-7-19 16:20 编辑
$this->db->select('prod_name, prod_price')->where(['prod_price >'=>5, 'prod_price <'=>10])->get('products')->result_array();
CI框架的连贯操作,请参考
页:
[1]