Re: Help in simple query!

2013-05-31 Thread gonzela2006
@Dakota
I'm already setting the relation as below

class Student extends AppModel {
var $name = 'Student';
var $hasMany = array('StudentAttendance');

AND

class StudentAttendance extends AppModel {
var $name = 'StudentAttendance';
var $belongsTo = 'Student';


On Thursday, May 30, 2013 8:26:28 AM UTC+2, Dakota wrote:
>
> That would be the expected result for that query. You aren't including the 
> 'SudentAttendance' model in your query. Looking how to use Containable, or 
> custom join. You don't say what kind of relation there is between 
> StudentAttendance and Student. CakePHP can't guess what you are trying to 
> do, you need to tell it (The guessing part is coming up in version 4 as 
> part of the MRD featureset)
>
>

-- 
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 cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Help in simple query!

2013-05-31 Thread gonzela2006
@Dr. Drijk @resting
Model names must be singular.

-- 
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 cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Help in simple query!

2013-05-29 Thread Dakota
That would be the expected result for that query. You aren't including the 
'SudentAttendance' model in your query. Looking how to use Containable, or 
custom join. You don't say what kind of relation there is between 
StudentAttendance and Student. CakePHP can't guess what you are trying to 
do, you need to tell it (The guessing part is coming up in version 4 as 
part of the MRD featureset)

On Thursday, 30 May 2013 01:46:53 UTC+2, gonzela2006 wrote:
>
> Hello,
>
> I used the following code in "StudentAttendances" controller:
>
> $students = $this ->StudentAttendance->Student-> find('all', array(
> 'conditions' => array(
> 'NOT' => array('StudentAttendance.date' => 
> array($year.'-'.$month.'-'.$day))
> ),
> 'fields' => array('Student.id', 'Student.name'),
> 'order' => 'Student.name ASC'
> ));
>
>
> On Wednesday, May 29, 2013 8:02:29 AM UTC+2, resting wrote:
>>
>> It will be helpful if you show us what you had done to produce that error.
>>
>>

-- 
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 cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Help in simple query!

2013-05-29 Thread resting
Have to agree with Dr. Drijk to check on typos.
Is it StudentAttendances.date instead?

On Thursday, 30 May 2013 07:46:53 UTC+8, gonzela2006 wrote:
>
> Hello,
>
> I used the following code in "StudentAttendances" controller:
>
> $students = $this ->StudentAttendance->Student-> find('all', array(
> 'conditions' => array(
> 'NOT' => array('StudentAttendance.date' => 
> array($year.'-'.$month.'-'.$day))
> ),
> 'fields' => array('Student.id', 'Student.name'),
> 'order' => 'Student.name ASC'
> ));
>
>
> On Wednesday, May 29, 2013 8:02:29 AM UTC+2, resting wrote:
>>
>> It will be helpful if you show us what you had done to produce that error.
>>
>>

-- 
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 cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Help in simple query!

2013-05-29 Thread gonzela2006
Hello,

I used the following code in "StudentAttendances" controller:

$students = $this ->StudentAttendance->Student-> find('all', array(
'conditions' => array(
'NOT' => array('StudentAttendance.date' => array($year.'-'.$month.'-'.$day))
),
'fields' => array('Student.id', 'Student.name'),
'order' => 'Student.name ASC'
));


On Wednesday, May 29, 2013 8:02:29 AM UTC+2, resting wrote:
>
> It will be helpful if you show us what you had done to produce that error.
>
>

-- 
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 cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Help in simple query!

2013-05-29 Thread Dr. Drijk
Checkup for typo's can be helpfull.
:)

Op dinsdag 28 mei 2013 22:53:39 UTC+2 schreef gonzela2006 het volgende:
>
> Hello,
> As you can see on the below image
>
>
> 
> I want to display students that didn't attendance on date 2013-03-01 so 
> the result should be as the following:
> *id name*
> 2 Marta Simon
> 4 Rex Maxwell
> 6 Vivian Ellis
>
> I know this is simple query but I got this error
> Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 
> 'StudentAttendance.date' in 'where clause'
>
> 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 cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Help in simple query!

2013-05-28 Thread resting
It will be helpful if you show us what you had done to produce that error.


On Wednesday, 29 May 2013 04:53:39 UTC+8, gonzela2006 wrote:
>
> Hello,
> As you can see on the below image
>
>
> 
> I want to display students that didn't attendance on date 2013-03-01 so 
> the result should be as the following:
> *id name*
> 2 Marta Simon
> 4 Rex Maxwell
> 6 Vivian Ellis
>
> I know this is simple query but I got this error
> Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 
> 'StudentAttendance.date' in 'where clause'
>
> 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 cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Help in simple query!

2013-05-28 Thread gonzela2006
Hello,
As you can see on the below image


I want to display students that didn't attendance on date 2013-03-01 so the 
result should be as the following:
*id name*
2 Marta Simon
4 Rex Maxwell
6 Vivian Ellis

I know this is simple query but I got this error
Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 
'StudentAttendance.date' in 'where clause'

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 cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.