Not sure, but check your hasOne, hasMany, belongsTo etc stuff... make
sure there are no typos there.

On Sep 11, 7:26 am, Klesus <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a problem with cakephp.
> I have just migrate cake php from 1.1 to 1.2 and cake php make a
> mistake with an autogenerated query.
> It is very strange.
>
> look : it is the cakePhp generated query
>
> SELECT `User`.`id`, `User`.`group_id`, `User`.`access_id`,
> `User`.`status_id`, `User`.`firstname`, `User`.`lastname`,
> `User`.`address`, `User`.`address2`, `User`.`city`, `User`.`state`,
> `User`.`zipcode`, `User`.`country`, `User`.`phone`,
> `User`.`cellphone`, `User`.`fax`, `User`.`email`, `User`.`password`,
> `User`.`created`, `User`.`login`, `User`.`filename`,
> `User`.`location`, `User`.`order_list`, `User`.`defaultview`,
> `User`.`defaulttime`, `User`.`activated`, `User`.`ban`,
> `Group`.`group_id`, `Group`.`manager_id`, `Group`.`groupname`,
> `Group`.`email`, `Group`.`filename`, `Group`.`location`,
> `Statu`.`status_id`, `Statu`.`name`, `Access`.`access_id`,
> `Access`.`access`, `Access`.`name`, `Access`.`admin` FROM `users` AS
> `User` LEFT JOIN `groups` AS `Group` ON (`User`.`group_id` =
> `Group`.`group_id`) LEFT JOIN `status` AS `Statu` ON
> (`User`.`statu_id` = `Statu`.`status_id`) LEFT JOIN
>            ^^^^^^^^^^
> `accesses` AS `Access` ON (`User`.`access_id` = `Access`.`access_id`)
> WHERE `User`.`email` = '[EMAIL PROTECTED]' LIMIT 1;
>
> The result is :
> SQL Error: 1054: Unknown column 'User.statu_id' in 'on clause'.
>
> That is normal because there is no statu_id in the User table but
> status_id (with an 's')
> when I execute the query with status_id instead of statu_id it works.
>
> I realy don't know where are the problem from.
> Why cakephp generate this query with a mistake ?
>
> Thanks for your help.
>
> Seb

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to