开发者

CodeIgniter pagination with this->db->query

开发者 https://www.devze.com 2023-02-02 19:05 出处:网络
How to use the codeigniter with $this->db->query() method? If i use active record class i would do like this:

How to use the codeigniter with $this->db->query() method?

If i use active record class i would do like this:

$query = $this->db->get('tb_cash_transaction',$num,$offset);
$this->db->order_by("CURRENCY_ID", "asc"); 

Now i am using the $this->db->query()

$query = "SELECT * FROM tb_cash_transaction, tb_currency, tb_user where tb_cash_transaction.CURRENCY_ID=tb_currency.CURRENCY_ID and tb_cash_transaction.USER_ID=tb_开发者_JS百科user.USER_ID and TYPE='cash_out'";   
$query = $this->db->query($query);

How to implement it? Thank you.


Try with this one..

$query = "SELECT * FROM tb_cash_transaction, tb_currency, tb_user where tb_cash_transaction.CURRENCY_ID=tb_currency.CURRENCY_ID and tb_cash_transaction.USER_ID=tb_user.USER_ID and TYPE='cash_out' order by CURRENCY_ID asc LIMIT $offset , $num";
$query = $this->db->query($query);

Hope this will Help.

Thanks!

Hussain

0

精彩评论

暂无评论...
验证码 换一张
取 消