You are here: Re: Group By problems « PHP « IT news, forums, messages
Re: Group By problems

Posted by Jasper Bryant-Greene on 09/28/81 11:20

W Luke wrote:
> Hi,
>
> I used to have problems with this in Cold Fusion - and I'm still
> struggling this time in PHP!

This isn't a PHP-specific question, it's more a MySQL question. You
might want to try the MySQL mailing lists if you don't get a
satisfactory answer here.

> Very basic. Looping over 2 tables - an email table, and a data-table.
> I'm using * just for ease for the time being:
>
> SELECT * FROM f_c_users,f_comments WHERE fcEmail=cemail GROUP by fcEmail
>
> If there are more than one records in the data table *per* email, then
> I want to group them into one email per user. Instead of sending
> 10/20/100 emails per person for each record in the data-table. So I
> just want to collate everyone's data into one email.

Unless you're using a very recent version of MySQL (4.1+) with the
GROUP_CONCAT function, I'd suggest just looping over the users table and
then looping over the data table separately inside the users loop.

Jasper

 

Navigation:

[Reply to this 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

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