Naming convention for the primary key in a Table
Posted
by kwokwai
on Stack Overflow
See other posts from Stack Overflow
or by kwokwai
Published on 2010-05-10T03:38:41Z
Indexed on
2010/05/10
3:48 UTC
Read the original article
Hit count: 354
cakephp
Hi all,
I am learning the Model relationship types in cakephp.
I have built twotables and in one of the Table A,
I got these fields in it:
Table A {postID, topic, content}
Table B {replyID, content, postID}
And when I ran the web page, a bunch of error related to SQL
popped up saying that
cakephp couldn't find post_id.
It is weird that I have already declared
the $primaryKey to be using postID in the tableA.php under Models folder,
but cakephp seemed want me to change the ID field to post_id instead of postID,
because the error disappeared after I have changed the primaryKey to post_id.
ANy ideas?
© Stack Overflow or respective owner