Re: baffled :<:<
| From: | Christian Reiniger | Date: | Tue, 17 Apr 2001 12:12:15 +0000 |
| Subject: | Re: baffled :<:< | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-48945@lists.php.net to get a copy of this message | ||
On Tuesday 17 April 2001 07:59, you wrote:
> can any one see a problem with this loop?
> while ( ($myrow = mysql_fetch_array($result) ) ) {
>
> $id = $myrow["id"];
> $card = $myrow["card"];
> $serial = $myrow["serial"];
> $avail = $myrow["avail"];
> $pn = $myrow["pn"];
> $cat = $myrow["cat"];
> $box = $myrow["box"];
> $quote = $myrow["quote"];
> }
> ?>
>
> if i call say just $card it only displays the one record (the last
> one), the minute i try to call $myrow["card"]; i get nothing at all...
> any idea's?
Sure. Let's say you pull 4 records from the DB, with the "card" field set
to "A", "B", "C" and "D" respectively. Now you loop over the
records,
setting $card to "A", then setting $card to "B", then to "C" and
finally
to "D". In other words: in each iteration you overwrite all previous
values
> I have script identical to this that works perfectly .. only difference
> is this one has different names for the values
I don't believe that, sorry :)
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
"Never doubt that a small group of thoughtful, committed people can
change the world...
Indeed, it's the only thing that ever has."
- Margaret Mead