Can you supply the schema of the table in question?
On Aug 7, 2:40 am, gjofum <[email protected]> wrote:
> You're right.
> But I merge 2 tables (in db) together, because retrieving data will be
> more faster (now i can join only 2 tables, but before I had to join 3
> tables, so it's much faster. I will query from this table every page,
> so speed is more important than saving data for me.)
> That's why I have id in table but it's not primary key.
> So inserting is no problem when I have var $cacheQueries = true; in my
> model. But I can't update it. I have to use in clause WHERE id = ? AND
> language_id = ? , but I don't know how to do that.
>
> On Aug 7, 6:57 am, Jamie <[email protected]> wrote:
>
> > I'm a bit confused. If you already know the primary key, why do you
> > need to test for another condition? The primary key is unique, after
> > all, so logically once you know the ID, you don't need to satisfy any
> > other 'WHERE' conditions.
>
> > If what you really want to do is ONLY save if language_id = a certain
> > value, then you can test for that before you save.
>
> > - Jamie
>
> > On Aug 6, 5:02 pm, gjofum <[email protected]> wrote:
>
> > > I'd like to update data in db, but I have a problem.
>
> > > If I use $this->...->save(...); it'll only use id (primaryKey) in
> > > clause WHERE. But I need one more (id = ? and language_id = ? in
> > > clause WHERE).
> > > How can I do that?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---