NEWBIE: Loading an array from a mysql_fetch_row output???
Posted: Wed Nov 13, 2002 8:09 am
What I read, and what I work with is the idea that the following only returns one "row" of info at a time, from the $result variable.
<?
$query = "select * from panties";
$result = mysql_query($query);
$number = mysql_num_rows($result);
for($i = 0; $i < $number; $i++)
{
$row = mysql_fetch_row($result);
for($k = 0; $k < count($row); $k++)
{
echo $row[$k];
}
}
?>
how would I (syntax value requested) load each row that is pulled from each $i loop into an array? What I want to do is use an "id" passing scheme inside my script so that I can loop through each rowset resident in the same script. I think I know how to do it (or at least a direction to press) but I can't seem to load the contents of the above into one array for continual use (pointer control is the goal). Am I heading in the wrong direction?
<?
$query = "select * from panties";
$result = mysql_query($query);
$number = mysql_num_rows($result);
for($i = 0; $i < $number; $i++)
{
$row = mysql_fetch_row($result);
for($k = 0; $k < count($row); $k++)
{
echo $row[$k];
}
}
?>
how would I (syntax value requested) load each row that is pulled from each $i loop into an array? What I want to do is use an "id" passing scheme inside my script so that I can loop through each rowset resident in the same script. I think I know how to do it (or at least a direction to press) but I can't seem to load the contents of the above into one array for continual use (pointer control is the goal). Am I heading in the wrong direction?