i create the code for text box, date and drop down within for loop and try to store those values in my DB using array concept. i search some code for internet and but not working good for storing data. I'm a newbie to PHP. Any idea would be great.
<?php
for($i=1;$i<=4;$i++)
{
?>
<tr>
<td>Name</td>
<td><input type="text" name="col_name[<?php echo $i;?>]" value=""/></td>
</tr>
<tr>
<td >Complete Address (Road Name, City, State, Country, Zip)</td>
<td><textarea name="add[<?php echo $i;?>]" value=""></textarea></td>
</tr>
<td> Date of birth(Ex.: mm-dd-yyyy)</td>
<td><input type="text" name="dob[<?php echo $i;?>]" id="dob<?php echo $i ;?>" value=""/>
</tr>
<tr>
<td>Sex</td>
<td><input type="radio" name="col_certi[<?php echo $i;?>]" value="Yes"/> Yes
<input type="radio" name="col_certi[<?php echo $i;?>]" value="No"/> No
</td>
<tr>
<td >Country</td>
<td><select name="countryid[<?php echo $i;?>]"/>
<option value="">Select</option>
</select>
</td>
</tr>
<tr>
<td>File Upload</td>
<td><input type="file" name="col_certi_file[<?php echo $i;?>]" value="<?php echo $fir_col_certi_file;?>"/></td>
</tr>
<tr><td align="center" colspan="4"><hr color="#6699CC" width="90%"/></td></tr>
<?php
}
?>
and i write the code for save the col_name data only using php
foreach($col_name as $colname)
$updatecol="update education set col_name='$colname' where employee_id=".$ employee_id;
if(!mysql_query($updatecol))
here the $colname last value only store in the database.. i want to store 4 value in database.. how to do it.