query($sql); $num = $result->num_rows; $counter = 0; $i = 0; while( $counter < $num) { $row = $result->fetch_assoc(); $opt[] = $row["items"]; $choice[] = $row["subid"]; echo " ".$opt[$i].""; $counter = $counter + 1; $i = $i + 1; } ?>