2017-06-23 89 views
0

我有以下的問題,我有我的mysql諮詢MySQL查詢在笨3

SELECT * FROM noticias.historicos WHERE fecha LIKE '%2017-06-23%' AND (titulo LIKE '%Chile%' OR bajadaNoticia LIKE '%Chile%') 

其確定,我需要轉移此查詢到MySQL笨查詢,感謝,並有愉快的一天

+0

https://www.codeigniter.com/userguide3/database/queries.html#regular-queries –

回答

0
$query = $this->db 
       ->select('*') 
       ->from('noticias.historicos') 
       ->like('fetcha','2017-06-23') 
       ->group_start() 
       ->like('titulo', 'Chile') 
       ->or_like('bajadaNoticia', 'Chile') 
       ->group_end() 
       ->get(); 
return $query->result(); //or return $query->result_array(); 

請嘗試上面的代碼或提到這link here

0

請找到下面提到的查詢。

$this->db->select('*'); 
$this->db->like('fecha', '2017-06-23'); 
$this->db->or_like(array('titulo' => 'Chile', 'bajadaNoticia' => 'Chile')); 
$query = $this->db->get('historicos''); 

這會幫助你。