Codeigniter operates mysql PHP code -- updates the CI framework
1) the query is not equal to and has equal
$ This-> db-> get_where ('host', array ('host' => 'ddd ', 'id! = '=> 0)-> row ();
2) 2. table intersection
Return $ this-> db-> select ('F. *, count (s. id) as subtotal ')-> from ('Category as f')-> join ('category S', 'F. id = s. upid ', 'left')-> where ('F. upid ', $ upid)-> group_by ('F. ID')-> order_by ('F. sort ', 'asc')-> get ()-> result ();
3) multiple order_by sorting
Return $ this-> db-> select ('*')-> from ('V _ category ')-> where ('upid', $ upid) -> order_by ('sort ', 'asc')-> order_by ('id', 'desc')-> get ()-> result ();
4) single record
Return $ this-> db-> get_where ('Category ', array ('id' => $ id)-> row ();
5) multiple records
Return $ this-> db-> get_where ('V _ category ', array ('upid' => $ upid)-> result ();
For more information, see default7 # zbphp.com.