Alex Hogan <mailto:[EMAIL PROTECTED]>
    on Thursday, March 18, 2004 10:39 AM said:

> Hi All,
> 
> 
> 
> I am parsing data returned from a field that looks like this;
> 
> 
> 
> 6-8-3-5-10-9-6__7-5-9--etc...
> 
> 
> 
> The code below parses out the data they way I want it but only
> returns the first row.  I need to compare all rows and return an
> average from each of the parsed out numbers.  Where have I made a
> mistake? 
> 
> 
> 

thanks for all the white space. one blank line isn't enough for my brain
to properly separate the different parts of your email. but now, thanks
to your extra white space i don't have a headache anymore. thanks again!
it really helps!

and now to more serious matters... ;)

> while($row = mssql_fetch_array($result)){

you're grabbing the entire result set all at once so you'll only execute
this while statement once. that's why it only does the first line. do
the the following instead:

$entire_recordset = mssql_fetch_array($result);

foreach($entire_recordset as $row)
{
    // looping code goes here
}

this is just my take on your code at first glance.


hth,
chris.

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

Reply via email to