$query = $this->db->get("table_name");
foreach ($query->result() $row)
{
echo $row->data;
}
显示数据 1 2 3 4 我需要两个像coloums 12 34
答案 0 :(得分:0)
试试这个:
$nm = 0;
$str = '';
$query = $this->db->get("table_name");
foreach ($query->result() $row)
{
$nm++;
$str .= $row->data;
if($nm%2==0){
echo $str;
$str = '';
}
}