Hi, I have a simple problem.
My script is composed of multiple routines:
- The For routine starts; prints a table containing a form.
- An Option Selection box is printed twice in the form, the contents are seeked in the MySQL Database using:
while ($row2 = mysql_fetch_array($result2, MYSQL_ASSOC)) {
echo "<option>".$row2[datestamp]."</option";
}
The problem is that: The mysql data seeked from the while loop (inside a for loop) appears only in one "for" loop
ex:
For ($i=0; $i<$h; $i++){
echo "<select name=\"name\">";
while ($row2 = mysql_fetch_array($result2, MYSQL_ASSOC)) {
echo "<option>".$row2[datestamp]."</option>";
}
echo "</select>";
};
The While loop will be skipped after the first for loop; this means that the select box will be empty.
Does anyone know why?
Is there a way to store the Rows seeked into a database ?