簡體   English   中英

使用Grocery CRUD CodeIgniter獲取自定義字段值

[英]get custom field value using Grocery CRUD CodeIgniter

如何從我的方法的另一個表中獲取字段的值? 當然,我有它表的主鍵。 我想在添加/編輯動作中做這樣的事情

if(is_empty(value_field_from_another_table)){
    $crud->edit_fields('first','second');
    $crud->add_fields('first','second');
}else{
    $crud->edit_fields('first');
    $crud->add_fields('first');
}
$query = $this->db->get_where('mytable', array('id' => $id), $limit, $offset);

or

$query = $this->db->get('mytable');


foreach ($query->result() as $row)
{
    echo $row->title;
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM