Re: SQL error 1064 in a hasMany through relationship

2011-07-20 Thread Diogo
Found the problem. I can't call functions from another controller unless the function is declared with the Model. On 20 jul, 00:23, Jeremy Burns | Class Outfit wrote: > What does your users controller look like? > > Jeremy Burns > Class Outfit > > http://www.classoutfit.com > > On 20 Jul 2011, at

Re: SQL error 1064 in a hasMany through relationship

2011-07-19 Thread Jeremy Burns | Class Outfit
What does your users controller look like? Jeremy Burns Class Outfit http://www.classoutfit.com On 20 Jul 2011, at 02:11, Diogo wrote: > The error. > > Warning (512): SQL Error: 1064: You have an error in your SQL syntax; > check the manual that corresponds to your MySQL server version for the

Re: SQL error 1064 in a hasMany through relationship

2011-07-19 Thread Diogo
The error. Warning (512): SQL Error: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'index' at line 1 [CORE/cake/libs/model/ datasources/dbo_source.php, line 684] Code | Context DboSource::showQuery() - C

Re: SQL error 1064 in a hasMany through relationship

2011-07-18 Thread Diogo
UPDATE I created a separated project to test this. Created 3 tables (users, projects, roles). Users: id, name Projects: id, name Roles: user_id, project_id, role Bake them all with Cake. Now I'm trying to call Role's index function in Users Controller, but it gives me the same error. Could thi

Re: SQL error 1064 in a hasMany through relationship

2011-07-17 Thread Diogo
Hi David, thank you for answering. Well I double checked the function name, where it has been created and also if the model UserRole is being loaded up (by calling get_class). Them model/controller/view were all generated by Bake, so I guess everything is allright. Even when I try to call a non-cu

Re: SQL error 1064 in a hasMany through relationship

2011-07-16 Thread David Kullmann
Diogo: Notice how in your trace it shows this: Model::call__() - CORE/cake/libs/model/model.php, line 502 Looking at the Model::call__() method you can see that it is designed to handle custom function calls: "Handles custom method calls, like findBy for DB models" Your model does not have

SQL error 1064 in a hasMany through relationship

2011-07-16 Thread Diogo
I've been trying to solve this for the past 3 days and nothing has came up. I've researched a lot and this errors usually come up when CakePHP can't find my model or I have some name wrong in my relationships. Well I tried looking at everything, but still couldn't find where the error is. I have a