You are here: Re: Using Count on 'Joined' tables « PHP Programming Language « IT news, forums, messages
Re: Using Count on 'Joined' tables

Posted by flamer die.spam@hotmail.com on 07/12/06 22:46

danny_m wrote:

> Hi there
>
> I have two tables, pages and sections, of which pages are a subset of
> sections. I'm listing out the sections in a list and want to include a
> COUNT of how many pages each section has within it.
>
> Pages contain a 'sectionid' field to join it to the 'id' in the seciton
> table but im unsure how to join, and group to get a count of the
> number of pages in each section (i.e. in each result row)
>
> If anyone can point me in the right direction, id be eternally greatful
> :-)

not sure if this is what you need exactly, but if your running two
separate mysql queries on the same page just:

$totalrows = mysql_num_rows($query1)+mysql_num_rows($query2);

Flamer.

 

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

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