我想获得此功能id
function load_gig()
{
$query = $this->db->query("SELECT * FROM gigs ORDER BY id DESC");
if ($query->num_rows() > 0)
{
return $query->result_array();
}
}
然后把它放在这里
function load_game_gig()
{
$query = $this->db->query("SELECT * FROM gigs WHERE id= ");
if ($query->num_rows() > 0)
{
return $query->result_array();
}
}
然后在视图中显示它
答案 0 :(得分:0)
假设您上面描述的功能是模型功能:
function load_game_gig($id)
{
$query = $this->db->query("SELECT * FROM gigs WHERE id= '.$id.'");
if ($query->num_rows() > 0)
{
return $query->first_row('array');
}
}
然后在控制器中:
$data = $this->model->load_gig();
$this->model->load_game_gig($data['id']);