I am new to php, I would like to generate the same select drop down list box. This is the code I have, but it only works for the first drop down, not for the second one...
This is the code I am using without any success :
<?php
while($row = mysqli_fetch_array($result))
{
$output .= '
<tr>
<td>'.$row["id"].'</td>
<td class="last_name" >
<select id="t1"><option>'.$row["t1"].'</option>';
while($rowcode=mysqli_fetch_array($resulttasks))
{ $output .= '<option value="'.$rowcode["id"].'">'.$rowcode["code"].'</option>' ; }
$output .='</select>
</td>
<td class="last_name" >
<select id="t2"><option>'.$row["t2"].'</option>';
while($rowcode=mysqli_fetch_array($resulttasks))
{ $output .= '<option value="'.$rowcode["id"].'">'.$rowcode["code"].'</option>'; }
$output .='</select>
</td>
</tr>';
?>
Thanks in advance for the help !
id="t1"ID will not repeat use different IDs or use class here.mysqli_data_seek($resulttasks,0);