Reply to Re: How do I do this query?

Your name:

Reply:


Posted by Pedro Graca on 09/29/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!

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация