|
Posted by Bent Stigsen on 01/15/06 11:41
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'),
>> 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?
Perhaps like so:
while ($row = mysql_fetch_assoc($result)) {
$data[] = $row;
}
> <snip>
>
> 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.
Naaa, not his problem. If duplicate rows is a problem, then it is
either, a job better done by the database, or a data integrity
problem, which shouldn't be painted over by a hack in an application.
/Bent
[Back to original message]
|