|
Posted by Pedro Graca on 09/27/23 11:37
Rich wrote:
>
> "Pedro Graca" <hexkid@dodgeit.com> wrote in message
> news:slrndsfj72.gck.hexkid@ID-203069.user.individual.net...
> <snip>
>> Example usage:
>>
>> <?php
>> $data = array(
>> array('name'=>'joe', 'bio', 'grade'=>'a'),
>> array('name'=>'jill', 'chem', 'grade'=>'b'),
>> array('name'=>'john', 'psych', 'grade'=>'b'),
>> array('name'=>'john', 'chem', 'grade'=>'a'),
>> array('name'=>'joe', 'bio', 'grade'=>'a'),
Extra row inserted on purpose.
>> array('name'=>'jill', 'psych', 'grade'=>'a'),
>> );
>
> That's not the format of the original data, how did you get the data into
> this convenient format?
I changed the original format to show another way to call the function.
As Bent said it could be the result of mysql_fetch_assoc()
> prints:
>
> name bio chem psych
> joe aa - -
> jill - b a
> john - a b
>
> Joe got an 'aa'?
>
> Looks like you forgot to account for duplicate rows.
If I wanted to ignore duplicate rows, I'd change the callback function.
Instead of concatening values I'd do a simple assignment ...
--
Mail to my "From:" address is readable by all at http://www.dodgeit.com/
== ** ## !! ------------------------------------------------ !! ## ** ==
TEXT-ONLY mail to the whole "Reply-To:" address ("My Name" <my@address>)
may bypass my spam filter. If it does, I may reply from another address!
Navigation:
[Reply to this message]
|