[英]Laravel 4 on Mac localhost: Cannot find driver for SQLSRV
[英]laravel cannot find driver (after completing migrations)
這不是Laravel通常的“找不到驅動程序”錯誤消息。 我能夠成功創建遷移並將其反映在數據庫中。 但是,當我嘗試插入或選擇時,我收到以下錯誤:
QueryException in Connection.php line 647:
could not find driver (SQL: insert into .....
這是我的遷移文件:
public function up()
{
Schema::create('vendors', function (Blueprint $table) {
$table->increments('id');
$table->string('vendor_name');
$table->string('contact_name');
$table->string('phone_number');
$table->string('alt_phone_number');P
$table->string('email')->unique();
$table->string('address');
$table->timestamps();
});
}
這是我的RESTful模型中的store()方法:
public function store(Request $request)
{
//
Vendor::create(request(['vendor_name', 'contact_name', 'phone_number', 'alt_phone_number', 'email','address']));
this.index();
}
我知道請求是獲取數據,因為我要做一個dd()
並完全查看內容。
這對我有用:
對於PDOException:找不到MySQL的驅動程序,如果它是基於Debian的操作系統,
sudo apt-get -y install php5-mysql
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.