I am loading a view like this
if($type == 'view'){
// do something
}else if($type == 'insert'){
// Here i am making a form
?>
<select>
<?php
foreach($applications as $row)
{
?>
<option value = "<?php echo $row->id;?>">
<?php echo $row->name;?>
</option>
<?php } ?>
</select>
<?
}else{
//do some thing else
}
Now this is the error i am encountering:
Parse error: syntax error, unexpected T_ELSE in url on line xx
The weird thing is that if i comment out the loop if works fine. What is the problem and how can it be resolved?
you need to use codeigniter loops in view way like this: