伙伴們,我收到錯(cuò)誤sqlstate 42s22 columnactivity_post_commentsnot found 1054 unknown column in 'field list'但是這個(gè)列名存在于我的數(shù)據(jù)庫(kù)中。我檢查了我的數(shù)據(jù)庫(kù)并檢查了拼寫(xiě)錯(cuò)誤,但我仍然收到此錯(cuò)誤public function storecomments(Request $request, $id){ // Create Comment $activity_post = new ActivityPost; $activity_post->activity_post_comments = $request->input('activity_post_comments'); $activity_post->activity_post_id = $id; $activity_post->user_id = auth()->user()->id; $activity_post->save(); return redirect()->back()->with('success', 'Comment Added');}不知道為什么我收到這個(gè)錯(cuò)誤所以我不能在我的數(shù)據(jù)庫(kù)中保存這個(gè)值模型:class ActivityPostComment extends Model{ use SoftDeletes; // Table Name protected $table = 'activity_post_comments'; // Primary Key public $primaryKey = 'id'; // Timestamps public $timestamps = true; /** * The attributes that should be mutated to dates. * * @var array */ protected $dates = ['deleted_at']; public function post(){ return $this->belongsTo('App\ActivityPost'); }}
sqlstate 42s22 列未找到“字段列表”中的 1054 未知列
達(dá)令說(shuō)
2021-07-06 16:55:57