Solved

find list cakephp

Posted on 2014-07-20
6
340 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
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

 

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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

705 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