在我看来,我正在尝试计算行数。根据我想省略最后三行并在我的视图中显示剩余的计数我的控制器:
$data['info'] = $this->TrainingEvaluationModel->getQ();
$this->load->view('TrainingEvaluationView', $data);
显示了数据来自的我的模型:
function getQ() {
$sql = $this->db->get('training_evaluation_entry');
return $sql->result();
}
我的看法如下:
<?php
foreach ($info as $row){
echo "<div class='row'>";
$i=$row->id;
echo "<div class='firstc'>".$row->id ."</div>";
echo "<div class='secondc'>".$row->name ."</div>";
echo '<input type="hidden" name="training_evaluation_entry_id'.$i.'" value='.$i.'>';
echo '<input type= "radio" name="group'.$i.'" value="strongly agreed"> Strongly Agreed';
echo '<input type= "radio" name="group'.$i.'" value="agreed"> Agreed';
echo '<input type= "radio" name="group'.$i.'" value="neutral">neutral';
echo '<input type= "radio" name="group'.$i.'" value="disagree">disagree';
echo '<input type= "radio" name="group'.$i.'" value="strongly disagree">strongly disagree';
echo "</div>";
}
?>
<input id="submit" type="submit" value="Submit" name="Submit">
</form>
我怎样才能忽略显示的最后三行?我正在使用codeigniter。请帮忙。谢谢