Hi all,
I am an advanced newbie :-)

I have to display results from a "payments" table.
Records are -> payment_amount, payment_date  (Ymd format)

Table should display years as rows, and months as columns (12 columns
for each year)

What's the best way to do this with cake?

I've built a query but of course it returns a "vertical" list

SELECT
    sum(payment_amount) as subtotal,
    concat(year(payment_date), month(payment_date)) as yeamon,
    year(payment_date) as yea,
    month(payment_date) as mon
FROM
    payments
group by yeamon
order by payment_date asc


With this query I will manage rows and columns using normal php.
I am wondering if there is a cakephp way. With sometthing like
find('please_return_my_magic_array_formated_in_a_shot')

I could create views if necessary

Thanks.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to