이 FIRST_ROW 필드와 함께 얻을하는 데 도움이 될 것입니다 감사합니다 :
$this->db->select('title'); // your column
$this->db->from('table'); // your table
$result = $this->db->get()->result(); // get result
$title = $result->first_row()->title; // get ist row using first_row with your field name
$graph->title->Set($title); // as you are using for graph
은 또한 점에 유의, CI 기능 row()
또한 객체 형태로 쿼리의 인도 표준시 행을 반환합니다. 수동에서
:
You can walk forward/backwards/first/last through your results using these variations:
$row = $query->first_row()
$row = $query->last_row()
$row = $query->next_row()
$row = $query->previous_row()
또는 당신은 당신이 좋아, PARAM 같은 단어 '배열'을 사용할 수있는 것보다 대신 객체의 배열에 결과를 인쇄 할 경우 :
$query->first_row(‘array’)
더 잘 이해하려면 CI 설명서를 참조하십시오. http://www.codeigniter.com/userguide3/database/results.html
답변을 확인 했습니까? – devpro
네, 그렇지만 작동하지 않습니다. –
결과를 에코하십시오 $ echo-> exit;'이 줄 앞에 제목을 가져 오는 지 여부'$ graph-> title-> Set ($ title);' – devpro