SQLSTATE [42S02]:基表或視圖未找到:1146表 'sp.sign_ups' 不存在(SQL:插入sign_ups
(first_name
,last_name
,email
,user_name
,password
,re_password
,contact
,updated_at
,created_at
)values(hassan,Mehedi,[email protected],marlin,marlin,marlin,01670654878,2016-05-15 06:39:07,2016-05-15 06:39:07 ))QueryException在Connection.php線673:
我正在面臨上面的問題,同時點擊提交按鈕發送註冊表單數據到數據庫。
這裏說'找不到基本表或視圖:1146表'sp.sign_ups'不存在'。 但在我的'sp'指定的數據庫中沒有任何一種名爲'sign_ups'的表。它名爲'sign_up'......
我已經丟棄了'sign_up'表並重新創建了它。 也重新啓動「Apache」和「MySQL」服務器。但沒有發生。
這是控制器SignUpController.php
<?php
命名空間應用\ HTTP \控制器;
使用請求;
使用App \ Http \ Requests;
使用App \ sign_up;
類SignUpController延伸控制器 {
public function showSignUp()
{
return view('sign_up');
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
sign_up :: create(Request::all());
return 'test';
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
}
這是模型sign_up.php
<?php
命名空間應用;
使用Illuminate \ Database \ Eloquent \ Model;
類sign_up延伸模型 { 保護$可填充= [ '如first_name', '姓氏', '電子郵件', 'USER_NAME', '密碼', 're_password', '接觸']; }
任何人都可以幫忙嗎?
代碼如果你重新創建你的'sign_ups'表,請確認此表在架構'sp'。 – Blank
你能解釋一下嗎@Reno ...... – Arafat
嗯,'sp'只是你數據庫的名字,你必須確認你已經在這個數據庫中重新創建了這個表,而不是其他的。像往常一樣,'表'sp.sign_ups'不存在'這種錯誤應該是你的數據庫中沒有表,或者你已經在其他數據庫中創建了你的表。 – Blank