[eluser]itz4mesays[/eluser]
I am trying to insert multiples values from selected checkboxes into the database and i can only insert one out of it. Tried your using insert_batch() but not getting it. I think i get the array properly. Can anyone please help me out? Thanks for your swift response and time to stop by to read this post.
My View
if(isset($select) && count($select)){
echo '<table border="1" cellspacing="0" cellpadding="3">';
//$data=array('onsubmit'=>'return confirmdelete()');
echo form_open('student/add_courses');
//echo"<form method='post' name='form' id='form' acti confirmdelete();'>";
echo '<tr valign="top">';
echo "<th width='50' align='center'><input id='delete' type='submit' name='delete' value='x'/></th>";
echo '<th>Course Code</th>';
echo '<th>Course Title</th>';
echo '<th>Course Unit</th>';
echo '<th>Course Status</th>';
echo '<th>Level</th>';
echo '<th>Semester</th>';
echo '</tr>';
foreach ($select as $key => $row) {
echo '<tr valign="top">';
echo '<td align="center"><input type="checkbox" name="checkbox[]" id="checkbox[]" value='.$row['id'].'></td>';
echo '<td align="center">'.$row['course_code'].'</td>';
echo '<td align="center">'.$row['course_title'].'</td>';
echo '<td align="center">'.$row['course_unit'].'</td>';
echo '<td align="center">'.$row['course_status'].'</td>';
echo '<td align="center">'.$row['level'].'</td>';
echo '<td align="center">'.$row['semester'].'</td>';
echo '</tr>';
//echo $row['id'];
}
echo '</table>';
echo"</form>";