Panggil data dan masukkan ke dalam array. Pastikan, sebelum coding, setkan nilai $i = 0
<?php $i = 0; $sql = "SQL Query...."; while { $ar_nama[$i] = $row['nama']; $i++; } ?>
<select name="new_name"> <?php for($j=0; $j < count($ar_nama); $j++) { echo "<option value='".$ar_nama[$j]."'>".$ar_nama[$j]."</option>\n"; } ?> </select>
<select name="new_name"> <option value="Mohd Firdaus">Mohd Firdaus</option> <option value="Mohd Saffuan">Mohd Saffuan</option> <option value="Mohd Fazuan">Mohd Fazuan</option> <option value="Mohd Azuan">Mohd Azuan</option> </select>
0 comments:
Post a Comment