Re: looping over $row (was "Re: [PHP-DB] Using two colomns ...")
| From: | David T-G | Date: | Mon, 20 Oct 2003 15:25:21 +0000 |
| Subject: | Re: looping over $row (was "Re: [PHP-DB] Using two colomns ...") | ||
| References: | 1 2 3 4 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-31187@lists.php.net to get a copy of this message | ||
John, et al --
..and then CPT John W. Holmes said...
%
% From: "David T-G" <davidtg-php@justpickone.org>
%
% > can't think of a practical example for which I would loop over $row...
% > Care to help me out?]
%
% How about a dynamic query where you do not know the number of columns
Hmmm... I suppose so, but I can't picture it. Shouldn't you always know
the DB schema and format of what you're going to get back? I can see not
knowing how many RECORDS you'll get back but I should think you would
know how many FIELDS will be in each.
Or maybe I'm just being too compulsive :-)
% that'll be returned? You would not want to use _array() as you'll have the
% duplicates to worry about / skip over. using _row() or _assoc() and just
% looping through that will suffice.
Oh, I can see that. It's the first half that still gets me.
%
% ---John Holmes...
Thanks & HAND
:-D
--
David T-G * There is too much animal courage in
(play) davidtg@justpickone.org * society and not sufficient moral courage.
(work) davidtgwork@justpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur
Pbzzhavpngvbaf Qrprapl Npg!