Welcome Guest, Not a member yet? Register   Sign In
database problem. Help me!
#4

[eluser]giaodn[/eluser]
[quote author="java" date="1182522923"]Ok! This is full code of table "thanhpho" :
Code:
function getCity()
    {
    
        $this->db->select('Ten');
        $this->db->select('ThanhPhoID');
        $this->db->from('thanhpho');
        $this->db->where('Enable', '1');
        $this->db->orderby('Priority');
        // load it
        return $this->db->get();
    }
and of table "hoahau" :
Code:
function getJoiner($Type)
    {
        //load
         $this->db->select('SoBaoDanh,HoTen,NgaySinh,DiaChi,ChieuCao,CanNang,VongNguc,VongEo,VongMong');
        //$this->db->select('Ten');// name of city
        $this->db->from('hoahau');
        //$this->db->join('thanhpho','ThanhPhoID = ThanhPhoID');// join 2 table
        $this->db->where('Enable','1');
        $this->db->orderby('HoahauID desc');
                
    return $this->db->get();
    }
i want to join 2 table via common field "ThanhPhoID" and want to get value of field "Ten" of table "thanhpho" to load into my page[/quote]
We don't need the source code, we need the DB schema or some thing that help us understand the relationship of a bow tables


Messages In This Thread
database problem. Help me! - by El Forum - 06-22-2007, 03:11 AM
database problem. Help me! - by El Forum - 06-22-2007, 03:19 AM
database problem. Help me! - by El Forum - 06-22-2007, 03:35 AM
database problem. Help me! - by El Forum - 06-22-2007, 04:30 AM
database problem. Help me! - by El Forum - 04-22-2008, 11:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB