You are here: Re: Counting in Dynamic Tables « PHP Programming Language « IT news, forums, messages
Re: Counting in Dynamic Tables

Posted by strawberry on 11/09/06 00:24

Gavin wrote:
> Hi,
>
> I have a question that i think will be pretty easy for someone 'in the
> know' to answer, but as of yet i have been unable to find anything on
> google.
>
>
> Basically, i have a page that is an overview of a shows reservations.
> On it i have a dynamic table that shows all the nights in the system
> for a particular show. I'd like one of the fields on each row of the
> table to display the total of reservations made for that night. So each
>
> row would display the total reservations (i.e. rows in the related
> table) for the night it refers to, much like a message boards 'replies'
>
> count.
>
>
> Any help on this would be great, i've tried the count function but i
> cant seem to get it to work with a dynamic 'Where = ' value. Perhaps
> i'm doing something wrong.
>
>
> All help much appreciated.
>
>
> Thanks,
> Gavin

let's suppose the table looks like this

reservations(reservation_id*,show,shownight)

SELECT `shownight` , `show` , count( `reservation_id` ) AS attendance
FROM reservations
WHERE shownight = '2006-11-09'
GROUP BY `show` , `shownight`
ORDER BY `show` , `attendance`;

 

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

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