[eluser]red2034[/eluser]
Hello all! my first post excitement...
on a page in my views folder I have this code that is displaying all my classes available in 'class_master'
Code:
<?php $classesMaster = $this->db->get('class_master')->result_array();
foreach($classesMaster as $row):?>
<tr><td width="50" align="center">
<a href="<?php echo base_url();?>index.php?student/classes/enroll/<?php echo $row['class_id'];?>" class="btn btn-gray btn-small">
<?php echo get_phrase('enroll');?></a></td>
then on my controller php I have this function:
Code:
function classes($param1 = '', $param2 = '', $classesMaster = '')
{
if ($param1 == 'enroll') {
$class_info = $this->db->get_where('class_master' , array('class_id' => $param2));
$data['class_id'] = $param2;
$data['title'] = $class_info['title'];
$this->db->insert('class', $data);
redirect(base_url() . 'index.php?student/classes/', 'refresh');
}
if I delete the $data['title'] = line it works fine by inserting the correct 'class_id' so I know everything is connected right, but as is after clicking the btn on the views page I am getting a blank white php page and the data has not been inserted into 'class'
can anybody see the reason why??? again excited to find this forum!