0
블로그에 대한 기능을 만들었지 만 올바르게 작동하지 않습니다. 컨트롤러 :실수는 어디에 있습니까? 잘못된 메시지가 표시됩니다.
$id_get = Model::factory('index')->get_id($slug);
$this->template->content = View::factory('index/article')
->set('slug', $mysql_respnse)
->set('commentars', Model::factory('index')->find_commentars($id_get));
보기 :
<?php
if($commentars){
echo 'There is a commentar!';
}
else{
echo 'There is no any commentar!';
}
?>
모델 :
public function get_id($slug){
$query = DB::query(Database::SELECT, 'SELECT id FROM ieraksti WHERE slug = :slug')
->parameters(array(':slug' => $slug))->execute()->as_array();
}
실수는? 스크립트에는 '의견이 없습니다!'라는 메시지가 표시되지만 '의견이 있습니다'라는 메시지가 필요합니다.
아마도 데이터베이스에 메모가 없습니다. –
내 데이터베이스에는 3 개의 댓글이 있습니다. 여기서 artcl_id는 3이고 블로그 글 ID는 3입니다. – reGative
'의견란'이란 무엇입니까? "논평", "논평"또는 "의견"과 "의견"을 의미 할 수 있습니까? – Darsstar