I have a simple challenge here with php mysql . I am a newbee in php and trying to write some code .
Below is my code:
$checked1 = $row['rmc_induction_softskill'];
$checked2= $row['rmc_induction_neo'];
$checked3 = $row['rmc_induction_itil'];
$checked4 = $row['rmc_induction_hr_induction'];
$checked5 = $row['rmc_induction_vmware'];
$checked6 = $row['rmc_induction_lss'];
I wish to run a loop and run single html line with all the above variable name in it in one-by-one fashion . For example , i want to have $checked1 == 1 , $checked2 == 1 .I have tried below code but not able to get $checked1 each time in loop
for ($i=1; $i<=33; $i++){
$checked = checked{$i};
echo $checked;
<td align="center" bgcolor="#E6E6FA"> <input type="checkbox" id="<?php echo $i.$rows['emp_id']; ?>" name="Emails[]" value="<?php echo $i.";".$concatenated_string; ?>" <?php if ($checked == 1) echo "checked" ; ?> onclick="check(<?php echo $i.$rows['emp_id']; ?>);" /></td>