SQLSTATE[42S02]: Base table or view not found: 1146 Table 'sp.sign_ups' doesn't exist (SQL: insert into 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))
I am facing above problem while clicking on submit button for sending sign up form data to database.
Here says 'Base table or view not found: 1146 Table 'sp.sign_ups' doesn't exist'. But in my 'sp' named database doesn't have any kind of table named 'sign_ups'. It named 'sign_up'......
Already I dropped the 'sign_up' table once and recreated it. Also restart the 'Apache' and 'MySQL' server. But nothing happened.
This is the controller SignUpController.php
<?php
namespace App\Http\Controllers;
use Request;
use App\Http\Requests;
use App\sign_up;
class SignUpController extends Controller {
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)
{
//
}
}
This is Model sign_up.php
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class sign_up extends Model { protected $fillable = ['first_name', 'last_name', 'email', 'user_name', 'password', 're_password', 'contact']; }
Can anybody help ?
sign_ups
table, please confirm this table was in schemasp
. – Blanksp
is just the name of your database, you must confirm you've recreate this table in this database, not other. As usual,Table 'sp.sign_ups' doesn't exist
this kind of error should be no table in your database or you've created your table in other database. – Blank