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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]