开发者

CodeIgniter admin

I am looking to create an admin side for my website, which is built in CodeIgniter. It will mainly manage content and upload portfolio pieces, etc... I have setup CodeExtinguisher as my admin right now. As of recently, this is a deprecated technology, no longer supported by JTaby(the author). I find it very useful and accomplishes a lot, most of what I want.

But it does have its limitations. It is table specific. Meaning that it generates data for a single table开发者_StackOverflow at a time. I am running into foreign key problems. I need to access data across tables but an not able to. Its how CodeExtinguisher builds it's queries.

This is more than question I am getting at. "How can I use CodeExtinguisher to query across multiple tables?" I need to access user_id from user table to insert id for foreign key constraint

Thanks for all the help guys.

Regards, -David


So, you can write code to get values form multiple tables like this

To get value of userid

    $this->db->select('userid');
    $this->db->insert('userTable', $data); 

    $userid=$data[0][]
    $row = $query->row(); 
    $userid = $row->userid;

To insert

    $data = array(
     'title' => 'My title' ,
     'name' => 'My Name' ,
     'userid' => $userid

    );

    $this->db->insert('mytable', $data); 

Also there is always option of writing your own query but I will not recommend it for simple cases.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜