为了账号安全,请及时绑定邮箱和手机立即绑定
关注
东堂

为什么报错呢错误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 源自:轻松学会Laravel-基础篇 4-2 83 浏览 1 回答
student(name age)

name 与 age  间没逗号

2020-02-10
回复 0

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信