그것은 오류를 보여주고있다 결과불법 문자열 오프셋 오류가
내 컨트롤러 파일 (client.php)에 있습니다.
public function viewlistdetail()
{
$id=base64_decode($_GET['id']);
$this->load->helper('client');
$this->load->model('client/Client_model');
$this->Client_model->viewlistdetail($id);
}
이 내가이 당신의 대답은 확실하지 않다 (client_model.php)
function viewlistdetail($st)
{
//echo $st;die;
$data['page_title'] = 'List View';
$data['detail']=$this->getlistdetail($st);
$this->load->view('client/general/head',$data);
$this->load->view('client/general/header');
$this->load->view('client/listview',$data);
$this->load->view('client/general/footer');
}
public function getlistdetail($id){
// $this->db->reconnect();
try{
$query1 = $this->db->query("SELECT id,name,detail,facility,address,city FROM listing WHERE id='$id'");
$str1=array();
if ($query1->num_rows() > 0)
{
$j=0;
foreach ($query1->result() as $row1)
{
$str1=array("id"=>$row1->id,"name"=>$row1->name,"detail"=>$row1->detail,"facility"=>$row1->facility,"address"=>$row1->address);
$str1['photo']=$this->getphoto($id);
$str1['price']=$this->getprice($id);
$str1['tag']=$this->gettag($id);
$j++;
}
}
else
{
$str1="No record Found";
}
}
catch (Exception $exd){
$str1= "error";
}
return $str1;
}
파일보기 (listview.php)
<h4><?php echo var_dump($detail['name']);?></h4>
<span class="bussadd"><?php var_dump($detail['detail']);?><span>
W 모자는 CI에서 MVC를 사용합니다. 모델 클래스에서 뷰를 호출하고 있습니다! 왜 컨트롤러에서 전화하지? –
배열을 게시 할 수 있습니까? var_dump ($ detail) –