报错如图:

最开始其实我的列名tname和tsubject分别叫name和subject,后来看到网上有说这个报错可能是数据库建表的时候使用了mysql的关键词,我就只把name改了。后来还是这个问题,百思不得其解。

后来同学告诉我说老师帮她检查SQL语句的问题时都是把php程序里的SQL语句先复制到mysql里面去执行看是不是数据库的问题的。

太tm机智了,我怎么没想到呢,姜还是老的辣。复制过去一看,怎么subject也是关键词啊! 很有信心的改掉以后等待正确结果,但是竟然还是这个错。。。

没关系,小场面。

后来我又是在数据库里面各种试,一次误操作int类型的那列给搞了个字符串然后插入失败。瞬间恍然大悟。把$age=$_POST['age'];改成了$age=(int)$_POST['age'];。然后果然就成功插入了。。。。

可是很奇怪,我之前写php并没有强制这样转换过也插入成功了啊,而且同学也没有这个操作,难道是版本问题???奇怪。。。。

SQL语句报错: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的更多相关文章

  1. 插入mysql语句报错:1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near

    插入一个很简单的sql语句时候,mysql一直报错: [SQL] INSERT INTO ORDER ( id, activity_id, order_type, phone, order_amoun ...

  2. mybatis批量更新update-设置多个字段值 报错 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near

    mybatis批量更新update-设置多个字段值 2016年08月01日 12:49:26 姚一号 阅读数:29539 标签: mysql mybatis批量更新批量更新allowMultiQuer ...

  3. myBatis查询报错 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near

    myBatis查询报错 You have an error in your SQL syntax; check the manual that corresponds to your MySQL se ...

  4. MySql 执行语句错误 Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near

    关于用Power Designer 生成sql文件出现 错误  [Err] 1064 - You have an error in your SQL syntax; check the manual ...

  5. 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups)VALUES('1','hh','hh@163.com','Boss')' at line 1

    mysql8.0版本 在已存在的表里插入一条数据 insert INTO api_user(id,username,email,groups)VALUES('1','hh','hh@163.com', ...

  6. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group t1,customer t2

    ### SQL: select t1.gid,t1.gname,t1.gvalue,t1.gtype, t1.gaddress,t1.gmembers, t1.gcode,t1.gphone, t2. ...

  7. [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''<h1 style="text-align: center;">php

    [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL s ...

  8. ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'type=InnoDB' at line 7

    问题: 使用hibernate4.1.1,数据库使用mysql5.1.30,使用hibernate自动生成数据库表时,hibernate方言使用org.hibernate.dialect.MySQLI ...

  9. 解决ROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'creat table study_record( id int(11) not null

    之前一直用的好好的,突然就出现了这个错误: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual tha ...

随机推荐

  1. MySQL 8.0 以上版本重置 root 用户密码的终极办法

    1. 在 /etc/my.cnf 文件末尾追加 skip-grant-tables [root@abdefg mysql]# vim /etc/my.cnf [mysql] # 设置mysql客户端默 ...

  2. qwq。。胡诌qwq

    1,十里寒塘,红楼灯火阑珊,晓风残月,思念醒了一半. 晨钟催落月,淑气催黄鸟,而花千树而你还未还,三月烟花,只剩远影孤帆,珠箔飘灯,大雁独自来返,柳絮铺地,桃花落了菀晚, 琴声弹起,雨落长安,长夜漫漫 ...

  3. Flutter之网络请求

    Flutter之网络请求 一,介绍与需求 1.1,介绍 1,http一个可组合的,基于Future的库,用于发出HTTP请求.包含一组高级功能和类,可轻松使用HTTP资源.它与平台无关,可以在命令行和 ...

  4. vsftp上传553 Could not create file错误解决

    可以正常连接,可是上传文件是提示553 Could not create file无法创建文件. 权限不足,从根目录开始检查保证每个文件夹都有777的权限,就可以正常上传.

  5. lintcode-720重排带整数字符串

    题目描述: 给一包含大写字母和整数(从 0 到 9)的字符串, 试写一函数返回有序的字母以及数字和. 样例 给出 str = AC2BEW3, 返回 ABCEW5字母按字母表的顺序排列, 接着是整数的 ...

  6. kubernetes --- weave

    #wget 'https://cloud.weave.works/launch/k8s/weavescope.yaml?k8s-service-type=NodePort&k8s-versio ...

  7. eggjs的参数校验模块egg-validate的使用和进一步定制化升级

    简单讲一下这个egg-validate egg-validate是基于parameter的. 安装 npm install --save egg-validate 启用 // config/plugi ...

  8. Kibana自动关联ES索引

    原因: Kibana中关联ES索引需要手动操作,如果ES中索引较多(如每天生成),则工作量会比较大. 方法: 考虑使用Linux的cron定时器自动关联ES索引,原理是调用Kibana API接口自动 ...

  9. 从太空到地球某个位置的轨迹录像制作 | Earth Zoom in/out Tutorial (Record Video)

    视频教程:Google Earth - Earth Zoom in/out Tutorial (Record Video) 下载google earth 在search里输入你想要去的地名 zoom ...

  10. centos如何添加ftp目录

    检查Centos服务器中是否安装了vsftpd rpm -qa |grep vsftpd 如果没有显示则没有安装 2.安装vsftpd yum -y install vsftpd 3.打开vsftpd ...