為什么報錯呢錯誤1064
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);
????}
}
2020-02-10
name 與 age? 間沒逗號