语法错误,意外T_VARIABLE

时间:2015-05-10 10:51:02

标签: php codeigniter

问题出在“查看”页面行“if(($ simn - > j $ i)== 1)”
我想要的是什么:
loop $ simn - > j1'直到$ simn - > j34
任何想法?

视图:

<?      
 $i=0;
foreach ($im as $row):
$i++;
 ?>
 <tr>
            <td><? 
            $var ='';
                if(($simn->j$i)==1)
                    $var='done';
                else
                    $var='not yet';
            echo anchor("admin/meeting/status_meeting/".$dk->u_id,"<input type='button' value='".$var."'>"); ?></td>
</tr>

<? endforeach; ?>

控制器:

$data['simn'] = $this->mmeeting->get_s_id($id)->row();

模特mmeeting:

function get_s_id($id){
        $this->db->where("k_id", $id);
        return $this->db->get("status_meeting");
    }

db table status_meeting:

`k_id` bigint(20) UNIQUE NOT NULL,
  `j1` int(1) DEFAULT 0,
  `j2` int(1) DEFAULT 0,
   ....
  `j34` int(1) DEFAULT 0,

0 个答案:

没有答案