this is my view
<?php foreach ($cart as $item): ?>
<tr>
<td><?php echo $item['name']; ?></td>
<td><?php echo $item['qty']; ?></td>
<td><?php echo number_format($item['subtotal'],2); ?></td>
<?php echo form_open_multipart('site/confirmed') ?>
<?php
$option = array();
foreach($instructor as $r){
$option[$r->id] = $r->instructor;
}
echo "<td>" . form_dropdown('instructor', $option) . "</td>";
?>
this is my model
'isbn' => $items['name'],
'price' => $items['price'],
'instructor' => $this->input->post('instructor'),
'qty' => $items['qty'],
when i use $this->input->post('instructor'), i always get zero.. help me please thanks in advance
Try this in your view :
<?php echo form_dropdown('instructor', $option, $this->input->post('instructor') ? $this->input->post('instructor') : $r->instructor); ?>