第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

在 Illuminate\Database\QueryException 處獲取未找到列錯(cuò)誤?

在 Illuminate\Database\QueryException 處獲取未找到列錯(cuò)誤?

PHP
鳳凰求蠱 2023-07-01 17:46:04
我正在 Laravel 應(yīng)用程序中工作,并將users表格與posts表格逐user_id列相關(guān)聯(lián)。我已經(jīng)user_id在表中有列了posts。但是當(dāng)我運(yùn)行php artisan db:seed命令時(shí),出現(xiàn)錯(cuò)誤:`SQLSTATE[42S22]:未找到列:1054“字段列表”中的未知列“user_id”出現(xiàn)以下錯(cuò)誤:   Illuminate\Database\QueryException   SQLSTATE[42S22]: Column not found: 1054 Unknown column 'user_id ' in 'field list' (SQL: insert into `posts` (`user_id `, `title`, `post_image`, `content`, `user_id`, `updated_at`, `created_at`) values (11, Perferendis dolorem eum ex nesciunt., https://lorempixel.com/900/300/?54025, Unde voluptatibus praesentium unde et illum qui quo. Cupiditate pariatur aperiam fugiat perspiciatis. In atque corrupti eius ipsam saepe blanditiis minima., 1, 2020-06-28 08:54:02, 2020-06-28 08:54:02))  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:671    667|         // If an exception occurs when attempting to run a query, we'll format the error    668|         // message to include the bindings with SQL, which will make this exception a    669|         // lot more helpful to the developer instead of just the database's errors.    670|         catch (Exception $e) {  > 671|             throw new QueryException(    672|                 $query, $this->prepareBindings($bindings), $e    673|             );    674|         }    675|   ? A column was not found: You might have forgotten to run your migrations. You can run your migrations using `php artisan migrate`.     https://laravel.com/docs/master/migrations#running-migrations      +13 vendor frames   14  database/seeds/DatabaseSeeder.php:21      Illuminate\Database\Eloquent\Relations\HasOneOrMany::save()      +1 vendor frames   16  database/seeds/DatabaseSeeder.php:22      Illuminate\Support\Collection::each()
查看完整描述

1 回答

?
開心每一天1111

TA貢獻(xiàn)1836條經(jīng)驗(yàn) 獲得超13個(gè)贊

我認(rèn)為在用戶模型的關(guān)系函數(shù)中,user_id 之后有一個(gè)空格?;蛘吣阈枰业侥阍谀睦锸褂昧藆ser_id后面的空格。

http://img1.sycdn.imooc.com//649ff60a000119a701450036.jpg

查看完整回答
反對 回復(fù) 2023-07-01
  • 1 回答
  • 0 關(guān)注
  • 211 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號