Please advice how do one do the following: I have a select option with MySQL values but with a slight twist. I have MySQL values 3, 1, 1 on 3 different lines and need to have the select option box display a select option with the first select box displaying the option 1, 2, 3. The second line only displaying the number 1 (As its only the number 1 in the query table) and the 3rd one exactly the same. These values can change depending on the number in the MySQL. At the moment its displaying the first row as 1, 2, 3 but in 3 different tables.
Here is my code:
$sql2 = mysql_query($sql);
while ($row = mysql_fetch_array ($sql2)) {
for ($i = 1; $i <= $rowcount; $i++):
?>
<td><select><center>
<option value="<?php echo $i ?>"><?php echo $i; ?></option>
</center></select></td>
<?php
endfor;
echo "</tr>";
};
I got it figured out. Here is the answer I was looking for:
<?php
echo "<td><select>";
for ($i=1; $i<=$rowcount; $i++)
{
?>
<center><option value="<?php echo $i;?>"><?php echo $i;?></center></option>
<?php
}
echo "</td></select>";
?>