Re: foreach

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/15/2012 8:39 PM, Jim Lucas wrote:
On 10/15/2012 05:16 PM, David McGlone wrote:
I've been sitting here playing around with foreach() and I'm wondering
why I
am getting these results. here's what I've been fooling around with.
the code
has no perticular meaning, but I noticed if the script fails, I get the
sentence "Too expensive I'm going home LOL" 6 times because there are
6 words
in the sentence. I also have a database that looks like this:

product_id        product        price
1                Milk        2.59
2                bread        1.05

And when $row is equal to 0 the output I get is
1 1 Milk Milk 2.59 2.59 Which is printed to the screen according to
how many
rows are in the db I belive.

So my question is why this behavior? I was expecting something like a
while
loop.


Code please.

You want code?  IF it's anything like what he showed already, who cares?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux