Re: Can I access database or execute some sql inside views ?

2007-08-14 Thread Wimg
one more question , how to pivot a table in controller? change this table a b 1 2 3 4 5 6 to c d f 1 3 5 2 4 6 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send ema

Re: Can I access database or execute some sql inside views ?

2007-08-14 Thread Wimg
how to pivot a table ? change a b 1 2 3 4 5 6 to c d e 1 3 5 2 4 6 ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe

Re: Can I access database or execute some sql inside views ?

2007-08-14 Thread Wimg
really helps me a lot , thx --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTE

Re: Can I access database or execute some sql inside views ?

2007-08-14 Thread fr3nch13
If you have your models setup correctly: hasAndBelongsToMany if the user can be a part of many groups, or User belongsTo Group | Group hasMany User if they only belong to one. Then in the method your controller: class GroupsController extends AppController { function index() {

Re: Can I access database or execute some sql inside views ?

2007-08-14 Thread starkey
In your controller get the data and pivot it, then send it to the view. Shawn On Aug 14, 8:49 am, Wimg <[EMAIL PROTECTED]> wrote: > The problem is like this, i have a database as below: > > user_id , group_id > > 1 1 > 2 1 > 3 2 > 4 2 > > i wan

Re: Can I access database or execute some sql inside views ?

2007-08-14 Thread Wimg
The problem is like this, i have a database as below: user_id , group_id 1 1 2 1 3 2 4 2 i wanna display users in the same group as a row in a table group1 group2 12 34 i was thinking that I get group_id first, then

Re: Can I access database or execute some sql inside views ?

2007-08-14 Thread RichardAtHome
Post the problem and lets see if we can help you out :-) On Aug 14, 10:29 am, Wimg <[EMAIL PROTECTED]> wrote: > correct,, i just have a problem do not how to solve --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ca

Re: Can I access database or execute some sql inside views ?

2007-08-14 Thread Wimg
correct,, i just have a problem do not how to solve On Aug 14, 5:01 pm, Langdon Stevenson <[EMAIL PROTECTED]> wrote: > > Can I access database or execute some sql inside views ? > > Given that this is PHP, yes I dare say you can. > > The point though is that you shouldn't. Perform your queries

Re: Can I access database or execute some sql inside views ?

2007-08-14 Thread Langdon Stevenson
> Can I access database or execute some sql inside views ? Given that this is PHP, yes I dare say you can. The point though is that you shouldn't. Perform your queries and business logic in your Controller and Model. Pass the resulting data to your view to render. That is all that your vie