I am using cake version 1.2.0.4986alpha
I have an array like this:
$this->data = Array
(
[Subscription] => Array
(
[delivery_mode] => both
[email_address_id] => 1
[select] => on
[community_id] => 1
[user_id] => 1
)
)
When I call $this->Subscription->save($this->data), I get a
"Column 'user_id' in where clause is ambiguous" error
The SQL is:
SELECT COUNT(*) AS count FROM `subscriptions` AS `Subscription` LEFT
JOIN `users` AS `User` ON (`Subscription`.`user_id` = `User`.`id`)
LEFT JOIN `email_addresses` AS `EmailAddress` ON
(`Subscription`.`email_address_id` = `EmailAddress`.`id`) WHERE
(`community_id` = 1) AND (`user_id` = 1)
So, I take it, the WHERE clause should look something like
`Subscription`.`user_id` = 1 instead, right?
(likewise for `community_id`)
I feel like this shouldn't happen when using Model::save, it hasn't
for any of my other models...
Am I just being an idiot and overlooking something? Or is this
possibly a bug? ...maybe both :-)
Thanks in advance,
Greg
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---