0
私はモデルで問題があります、私を助けてください!文字列変換への配列Codeignater_3
私はバレルに2つのテーブルを持ち、そのうちの1つにIDと、必要なすべての列と、ビューに表示する必要がある情報を含む別のテーブルがあります。
モデル:
function get_categories_id_in_tournament($id)
{
$this->ci->db->SELECT('weight_from AS w_from, weight_to AS w_to, gender AS gen, age_from AS a_from, age_to AS a_to');
$this->ci->db->FROM('categories');
$this->ci->db->JOIN('tournament_categories', 'category_id = id');
$this->ci->db->where('tournament_id', $id);
$query = $this->ci->db->get();
return $query->result_array();
}
コントローラー:
$data = array(
'get_categories' => $this->tournaments_model->get_categories_id_in_tournament($id),
);
ビュー:
foreach ($get_categories as $row2)
{
echo
$row2;
}