Re: loop weirdness

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

 



On 19 Aug 2008, at 16:10, Dan Shirah wrote:
Your comments indicate you're trying to end the if in the middle of the while, but what PHP will be doing is ending the while where you want to end the if. I assume what you actually want to do is end both after the HTML is output, but I'm just guessing.

-Stut

Depending on specific conditions, one of two queries will be ran.

In one query $f_date == "" and in the other $f_date == "some date"

If $f_date == "some date" then I will have multiple rows of data returned so I would need to use:

while($row = ifx_fetch_row($info) {

But, if $f_date == "" then only a single row would be returned and I would use:

$row = ifx_fetch_row($info);

So, depending if $f_date is "" or "some date" I have A LOT of tables and data that are populated with results pulled from the seperate queries and I don't want to duplicate all of that data.

Perhaps I'm not understanding correctly, but you can still use the while loop if only a single row is returned, it'll just run the loop once.

-Stut

--
http://stut.net/

--
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