如何解决尝试使用SQL插入表时,Laravel / React在我需要使用下划线作为列名的同时添加了一个点
我正在使用React&Laravel开发一个应用程序,并且试图将user_id与order_item链接起来。我得到的全部错误是
`"message": "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'bestellingen.id' in 'where clause' (SQL: select * from "bestellingen" where "bestellingen"."id" = oRPCiPfwNL5Dx limit 1)"`. So it's looking for a column called `bestellingen.id` while my column in the db is named `bestellingen_id`
我尝试查找列的方式是这样的:
let bestellingKoppeling = {
klant_id: json.data.klant,bestel_id: this.props.finalOrder['bestelling_id_order']
}
然后我用AXIOS.post("http://localhost:8000/api/koppelklantbestelling",bestellingKoppeling)
去Laravel并
public function storeBestelling(Request $request) {
$bestelling = Bestellingen::find($request->bestel_id);
$bestelling->klant_id = $request->klant_id;
$bestelling->save();
return $bestelling;
}`
我运行实际命令从数据库中获取项目并更新user_id(klant_id)列。 有帮助吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。