Welcome Guest, Not a member yet? Register   Sign In
search in two tables
#5

[eluser]anyamanggar[/eluser]
[quote author="skunkbad" date="1343010735"]This is documented @ http://ellislab.com/codeigniter/user-gui...ecord.html :

Code:
$this->db->select('*');
$this->db->from('info');
$this->db->join('berita', 'info.id = berita.id');
$this->db->like('info.title',$keyword);
$query = $this->db->get();
[/quote]

i try your code, the results is didnt show,

Code:
function cariinfo($keyword) {
$this->db->select('*');
$this->db->from('info');
$this->db->join('berita', 'info.id = berita.id');
$this->db->like('info.title',$keyword);
$query = $this->db->get();
}

but if i try like this (search in one table) its work, the result for what i search its show

Code:
function cariinfo($keyword) {
  
  $this->db->like('title',$keyword);
  return $this->db->get('info')->result();
}



Messages In This Thread
search in two tables - by El Forum - 07-21-2012, 05:37 PM
search in two tables - by El Forum - 07-21-2012, 08:29 PM
search in two tables - by El Forum - 07-22-2012, 07:11 PM
search in two tables - by El Forum - 07-22-2012, 07:32 PM
search in two tables - by El Forum - 07-22-2012, 07:56 PM
search in two tables - by El Forum - 07-22-2012, 08:00 PM
search in two tables - by El Forum - 07-22-2012, 08:20 PM
search in two tables - by El Forum - 07-22-2012, 08:29 PM
search in two tables - by El Forum - 07-22-2012, 09:22 PM
search in two tables - by El Forum - 07-22-2012, 09:29 PM
search in two tables - by El Forum - 07-22-2012, 10:42 PM
search in two tables - by El Forum - 07-22-2012, 11:38 PM
search in two tables - by El Forum - 07-22-2012, 11:40 PM



Theme © iAndrew 2016 - Forum software by © MyBB