while ($row =mysql_fetch_array ($result))
{
echo $row [0];
}
Why this will be able to put the data of the query one output, but put into the for loop inside no, shape such as:
for ($i =0; $i <366; $i + +)
{
echo $row [0];
}
This will not be the correct output of the data!
If I want to put the data queried from the database into a for loop what to do, like Odbc_fetch_into ($result, $row) function has no, put the data results into the array, through the array of the following table to manipulate the data set. Please teach the great God.
Reply to discussion (solution)
Use for loop to write
for ($i =0; $row =mysql_fetch_array ($result); $i + +) { echo $row [0];}
while ($row =mysql_fetch_array ($result))
{
Array_push ($array, $row [0]);
}
Var_dump ($array);
Use for loop to write
for ($i =0; $row =mysql_fetch_array ($result); $i + +) { echo $row [0];}
This is a dead loop.
Why is the cycle of death?
You seem to have more than one database field, but you do echo $row [0];
Use for loop to write
for ($i =0; $row =mysql_fetch_array ($result); $i + +) { echo $row [0];}
while ($row =mysql_fetch_array ($result))
{
Array_push ($array, $row [0]);
}
Var_dump ($array);
Study the
Landlord does not understand the difference between for and while Ah