Re: [SOLVED] Re: can a session be used in a query?

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

 



Frank Stanovcak wrote:
> if you want to know what is happening...I just did the research...the while
> statment runs untill the condition is false.  This means that, this your 
> case,
> $row = false.  We were getting results in the loop becuase that never
> happened while it was looping, but to end the loop it proccessed $row =
> false and then quit setting $row ="" for the rest of the program.
> 
> if you are expecting more than one row as a result set you may want to think
> about outputing the result to an array like this
> 
> while ($row = mysql_fetch_array($result)){
>              echo $row['AddEditAdmin']; //to print out the value of column
> 'var1' for each record
>             $rowset[] = $row;
>        }
>    }else{
>                   echo 'No records found.';
>     }
> 
> this will give you a zero enum array of all the returned records.
> they could be accessed with $rowset[n][column name] anywhere in the code.
> 
> Hope that helps!  I know I learned from it.
> 
> Frank
> 
> "tedd" <tedd.sperling@xxxxxxxxx> wrote in message 
> news:p06240806c58be7e24bfa@[192.168.1.101]...
>> Terion Miller wrote:
>>
>>> SOLVED: Thanks everyone I got it working it was the loop...took it out and
>>> now it works like a charm!! Is there a way to mark things solved?
>> Normally, when one post [SOLVED] in the subject line, the post also 
>> provides the solution.
>>
>> As it is now, a person with a similar problem would have to read the 
>> entire thread to figure out what you did to solve the problem you faced. 
>> They would have to figure out what you meant when you said "...took it out 
>> and now it works like a charm!!" ?
>>
>> Would it not be easier just to post the corrected code?
>>
>> If possible, always put back more than you take.
>>
>> Cheers,
>>
>> tedd
>>
>> -- 
>> -------
>> http://sperling.com  http://ancientstones.com  http://earthstones.com 
> 
> 
> 

Umm, example of the solution that actually works would be great.

I understand what you are saying, but the in six months the guy that is having this same/similar problem will be looking at the above code snippet and
ask him self....  WTF???

-- 
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
       and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
    by William Shakespeare

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