Fetches all but one?!
Posted: Sun Jun 12, 2011 11:45 pm
In my table I have A B C D,
[syntax=php]
$mysql->query("
SELECT
`name`
FROM `categories` ORDER BY `name` ASC
");
$mysql->fetch($row);
$return = array();
while ($mysql->fetch($row)){
$return[] = $row;
}
return $return;
[/syntax]
and then,
[syntax=php]
foreach($rows as $row) {
echo $row['name'];
echo "<br />";
}
[/syntax]
but here is the weird thing, it only echoes B C D and if I change the order to DESC it echoes C B A I never run into this problem before![Shocked :shock:](./images/smilies/icon_eek.gif)
[syntax=php]
$mysql->query("
SELECT
`name`
FROM `categories` ORDER BY `name` ASC
");
$mysql->fetch($row);
$return = array();
while ($mysql->fetch($row)){
$return[] = $row;
}
return $return;
[/syntax]
and then,
[syntax=php]
foreach($rows as $row) {
echo $row['name'];
echo "<br />";
}
[/syntax]
but here is the weird thing, it only echoes B C D and if I change the order to DESC it echoes C B A I never run into this problem before
![Shocked :shock:](./images/smilies/icon_eek.gif)