# |
Mar 17th 2018, 18:54 |
joopm |
i made a query filter it with ->group(['model_id']) i also want that only the last datetime ->order(['created'=>'DESC']) |
# |
Mar 17th 2018, 18:52 |
joopm |
my problem is a bit more complicated |
# |
Mar 17th 2018, 18:52 |
Rif2007 |
i dont know if i will be able to help but let others see |
# |
Mar 17th 2018, 18:51 |
Rif2007 |
what was your problem joopm |
# |
Mar 17th 2018, 18:51 |
Rif2007 |
ahh... let me reback... |
# |
Mar 17th 2018, 18:50 |
joopm |
make it composite in mysql and cake will make automatically the associations for you |
# |
Mar 17th 2018, 18:49 |
joopm |
than dont use 'id' field in the table just the 2 foreing key names |
# |
Mar 17th 2018, 18:49 |
joopm |
but if you really need using composite keys |
# |
Mar 17th 2018, 18:49 |
joopm |
yes dont mess with 'id' |
# |
Mar 17th 2018, 18:48 |
dereuromark |
I agree. Keep things simple. id as only primary key. |
# |
Mar 17th 2018, 18:48 |
Rif2007 |
yes |
# |
Mar 17th 2018, 18:48 |
Rif2007 |
Lucky me I am just 3 days old. But how to handle around the association. Yes, I have firsts, seconds as well |
# |
Mar 17th 2018, 18:48 |
joopm |
and you want to connect them in the thirds |
# |
Mar 17th 2018, 18:48 |
joopm |
as i suppose you have a firsts,seconds tables too |
# |
Mar 17th 2018, 18:47 |
joopm |
if you still learn cakephp using composite keys not the best practice |
# |
Mar 17th 2018, 18:45 |
joopm |
moment |
# |
Mar 17th 2018, 18:45 |
Rif2007 |
and the table has 3 fields (id [PK], first_id[PK], data3) |
# |
Mar 17th 2018, 18:43 |
Rif2007 |
sorry for the wired formating |
# |
Mar 17th 2018, 18:43 |
Rif2007 |
public function view($id = null) { $third = $this->Thirds->get($id, [ 'contain' => ['Firsts'] ]); $this->set('third', $third); } |
# |
Mar 17th 2018, 18:42 |
Rif2007 |
it exists alright |
# |
Mar 17th 2018, 18:42 |
Rif2007 |
this is just a fresh bake with a table having a composit primary key |
# |
Mar 17th 2018, 18:42 |
joopm |
did you check in the database manually if that record exist? |
# |
Mar 17th 2018, 18:41 |
Rif2007 |
so I have this ----> Record not found in table "thirds" with primary key ['1'] |
# |
Mar 17th 2018, 18:41 |
joopm |
so as i see you have a thirds table |
# |
Mar 17th 2018, 18:41 |
Rif2007 |
ok, a ray of hope.... |
# |
Mar 17th 2018, 18:41 |
Rif2007 |
oh, so they help |
# |
Mar 17th 2018, 18:41 |
joopm |
tell me your question first |
# |
Mar 17th 2018, 18:40 |
joopm |
nou i am not really new here |
# |
Mar 17th 2018, 18:40 |
Rif2007 |
Lets see what problem you got.... |
# |
Mar 17th 2018, 18:40 |
Rif2007 |
I am new here |
# |
Mar 17th 2018, 18:40 |
Rif2007 |
no one here seems to help anyone |
# |
Mar 17th 2018, 18:40 |
joopm |
i face with a little issue |
# |
Mar 17th 2018, 18:40 |
joopm |
would you help me please |
# |
Mar 17th 2018, 18:40 |
joopm |
hello |
# |
Mar 17th 2018, 18:38 |
Rif2007 |
anyone ? |
# |
Mar 17th 2018, 18:38 |
Rif2007 |
Record not found in table "thirds" with primary key ['1'] |
# |
Mar 17th 2018, 18:36 |
Rif2007 |
anyone with "Record not found in table "thirds" with primary key ['1']" |
# |
Mar 17th 2018, 18:33 |
Rif2007 |
Need some help |
# |
Mar 17th 2018, 18:33 |
Rif2007 |
hi guys, this is my first cake bake irc |
# |
Mar 17th 2018, 18:01 |
banna |
Error: Class 'IntlDateFormatter' not found |
# |
Mar 17th 2018, 18:00 |
banna |
Where can I find intl.so for php 7.2 |