Reply to Re: How do I do this query?

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на 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

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