我試圖獲取最後插入的記錄的ID在Db中。但我得到的錯誤獲取上次插入的記錄的ID
Parse error: syntax error, unexpected T_RETURN in Z:\www\CI4\application\models \report_model.php on line 69
我的模型:
function getLastInserted() {
$query ="SELECT $id as maxID from info where $id = LAST_INSERT_ID()"
return $query; //line 69
}
我的控制器:
function index()
{
$id=$this->report_model->getLastInserted();
$this->load->view('u_type1',$id);
}
oops..silly mistake..embarrassing ...感謝反正:) –