我在symmfony应用程序中的两个表之间有一对多的关系。其中一个表的注册方法接受JSON POST请求。在试图将数据从MySQL接口一切手动插入到数据库是好的,但是当我尝试使用POST请求执行插入我得到Symfony:完整性约束违规:500内部服务器错误
500 Internal Server Error with a Integrity constraint violation:
这是POST请求的控制器
$register->setConfirmpassword($params["confirmpassword"]);
$register->setAccountfk($params["accountsfk"]);
这是从邮递员样品JSON后
{
"accountsfk":2
}
注册有一个外键账户。在作出POST请求我得到这个错误
使用参数[" MYNAME "," mylastname "," [email protected] ","密码","密码",空]:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'accountsfk' cannot be null (500 Internal Server Error)
请问我做错了,我无法将记录插入到注册表中
你能请出示你的实体? –
哪个实体 – parker
实体注册请 –