Solved

find list cakephp

Posted on 2014-07-20
6
334 Views
Last Modified: 2014-07-26
HI,

In cakephp when I 'find all' I get all the required data and associated models as expected.
However with a find list I dont get the associated array value of tutoringtype which  appears in a find all.

Lesson  related to student related to tutoringtype

With the below code find list I get cant find tutoringtype col error.
The docs are not clear on this
http://book.cakephp.org/2.0/en/models/retrieving-your-data.html

 
//i have tried different recursive  values
$students = $this->Lesson->Student->find('list', array('conditions' =>
                    array(
                       'TutoringType.value' => 'Individual Tuition',
                        'recursive' => 2 
                        )));
		
		
                $students2 = $this->Lesson->Student->find('all');
                debug($students);
            

Open in new window

0
Comment
Question by:jagguy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 40207717
Why is this posted in CSS?  There is no part of it even remotely related to  CSS.

Cd&
0
 

Author Comment

by:jagguy
ID: 40208023
? remove it from css as it was a mistake?
do you have an answer?
0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 40208234
Have you linked models as per this associations rules? http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html

can you share those associations?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Accepted Solution

by:
jagguy earned 0 total points
ID: 40208650
I rebooted the server and the code now works so I didnt make a mistake
0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 40208745
That's fine. All the best!
0
 

Author Closing Comment

by:jagguy
ID: 40221103
I found the answer
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
These days socially coordinated efforts have turned into a critical requirement for enterprises.
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question