Illuminate\Database\QueryException
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'age) values(?, ?)' at line 1 (SQL: insert into student(name age) values
代码为
<?php namespace App\Http\Controllers; use Illuminate\Support\Facades\DB; class StudentController extends Controller { public function test1(){ $bool=DB::insert('insert into student(name age) values(?, ?)',['东堂',18]); var_dump($bool); } }
student(name age)
name 与 age 间没逗号