2017-02-22 46 views

回答

0

使用OR獲得 「無限」 值:

<?php 
$this->db->select('*'); 
$this->db->from('userinfo'); 
$this->db->where('expiration <', $cur_date); // for expired users 
       OR 
$this->db->where('expiration >', $cur_date); // for active users 
$this->db->or_where('expiration', $unlimited_value); // or_where 
?> 
+0

謝謝@Pathik ..都在這裏工作。 –

+0

@VikramSoni welcome –

+0

function getactiveusers(){ $ this-> db-> where('expiration>',date('d M Y')); $ this-> db-> or_where('expiration','Unlimited'); $ query = $ this-> db-> get('userinfo'); return $ query-> result(); } –

0
$this->db->where('expiration <', $cur_date); 

$this->db->where('expiration >', $cur_date); 
+0

我們可以添加或條款這裏就像過期<$ cur_date或到期=無限。 –

+0

@VikramSoni @VikramSoni你是什麼意思由「無限」 –

+0

@VikramSoni什麼是列檢查「無限」 –

相關問題