1
我有一些代碼產生以下錯誤。我該如何解決它?SQLSTATE [42S22]:未找到列:1054'where子句'中的未知列'name'
"SQLSTATE[42S22]: Column not found: 1054 Unknown column ' name' in 'where clause' (SQL: select count(*) as aggregate from `authors` where ` name` = Azzario Razy Junaidi and `id` <> 4)"
AuthorsController.php
public function update(Request $request, $id)
{
$this->validate($request, ['name' => 'required|unique:authors, name,'.$id]);
$author = Author::find($id);
$author->update($request->only('name'));
Session::flash("flash_notification", [
"level" => "success",
"message" => "Berhasil menyimpan $author->name"
]);
return redirect()->route('authors.edit');
}
哪個框架是你使用.. ?? –
Laravel框架 –
應該有名稱周圍的名稱爲> name ='Azzario Razy Junaidi'和id <> 4 – Khan