Michael,

I'm not sure I see what the problem is. Your link/button can certainly
pass any search parameters you want in to your action. It sounds like
you might be planning to offer a small form for the user to choose
search params? The Form Helper will let you put all that together and
the data will come back to you in $this->data in your action (http://
book.cakephp.org/view/1383/Form). The action can make use of the
parameters to build a $this->yourModel->find() call. The returned data
will be be passed along to the view because actions by default render
their associated views. All pretty standard stuff unless I'm
misreading your message.

If you're really planning on writing that sql by hand, you might want
to review this http://book.cakephp.org/view/1017/Retrieving-Your-Data

Regards,
Don


On May 31, 10:28 am, mivogtGermanyLU <[email protected]> wrote:
> Hi there,
>
> my app has several models with defined relations.
> Entering Data works fine also all the CRUD stuff is fine.
>
> Now  I need to collect data from the database ostly leftjoined and
> limited and sorted by some definitions... so far as first step I made
> me an SQL statement trying inside phpmyadmin and it works fine.
>
> To get it more comfortable I would like to have a view offering to set
> the data-limiters.
> In my case it will be a month/year datafield and the id of one model
> all the other stuff is linked somehow.
>
> I am not sure about how to go on with this and would be happy to get a
> helping comment...
>
> I guess I will need a SelectWhatToReport-View to select month/year/
> model_id
> passing this to a controller-action CreateReport($month,$year,
> $model_id)
>
> in controller I might add the new action
> CreateReport($month,$year, $model_id)
> {sql='select ... where .. $month .. ,$year, ..  $model_id'
> // . creating sql result array to be passed to a view
>
> }
>
> not sure about how to call a 2nd view from controller to display the
> result from SqlResultArray using some while statements ...
>
> ok maybe I better rewrite in short sentences what I want to know/need
> to do:
> - need to get a view offering to choose an entry of a model from
> database (sems to be easy I hope)
> - passing this selectioncriteria  to controller/action (hopefully just
> by pressing a button)
> - calling a view from controller side to display the result (sql
> array)
>
> Thanks in advance
>
> Michael

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to