well here i am again..actually i removed the original post and edited
it so that it will be clearer to all of us:
here we go:
i just try to explain the problem after theses snippets of code:
db structure:
1. model1
-id
2. model2
-id
3. model1_model2
-id
-model1_id
-model2_id
model:
class Model1 extends AppModel{
var $name='Model1';
...
...
...
function model1Method(){
....
....
....
}
}
class Model2 extends AppModel{
var $name='Model2';
...
...
...
function model2Method(){
....
....
....
}
}
class Model1Model2 extends AppModel{
var $name='Model1Model2';
...
...
...
function model1Model2Method(){
....
....
....
}
}
controller:
class MyController extends AppController{
var $uses=array('Model1','Model2','Model1Model2');
function dispModel1(){
$this->Model1->model1Method(); //works fine
}
function dispModel2(){
$this->Model2->model2Method(); //works fine
}
function dispModel1Model2(){
$this->Model1Model2->model1Model2Method(); //doesnt work.. error:
SQL Error: 1064: You have an error in your SQL syntax
}
}
-----------------------------------
so the problem is cake cant find the model's method instead cake
executes it as an sql query.
the actual name of my model is EnrolleesOfferedSubject with a table
name of enrollees_offered_subjects..
why is it that cake cant find any method i placed in my
EnrolleesOfferedSubject model?
is it maybe because of my models name? because other model with only
one word on it works just well...
and one thing, EnrolleesOfferedSubject's model methods can be
executed using EnrolleesOfferedSubjectController only but cant be
executed OnAnyOtherController... please help me guys..enlighten me..im
really stuck!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---