报错如图:

最开始其实我的列名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. artillery 学习一 简单使用

    artillery 是一个不错的负载测试套件,功能很强大,支持多协议 安装 npm install -g artillery --unsafe-perm 运行一个简单的快速测试 artillery q ...

  2. luogu P1725 琪露诺

    二次联通门 : luogu P1725 琪露诺 /* luogu P1725 琪露诺 DP + 线段树 用线段树维护dp[i - R] ~ dp[i - L]的最大值 然后 转移方程是 dp[i] = ...

  3. Mongoose 预定义模式修饰符 Getters 与 Setters 自定义修饰符

    mongoose 预定义模式修饰符 mongoose 提供的预定义模式修饰符,可以对我们增加的数据进行一些格式化,主要有:lowercase.uppercase .trim,这里不一一演示,对trim ...

  4. 为什么 Redis 单线程能支撑高并发?

    阅读本文大概需要 4 分钟. 作者:Draveness 最近在看 UNIX 网络编程并研究了一下 Redis 的实现,感觉 Redis 的源代码十分适合阅读和分析,其中 I/O 多路复用(mutipl ...

  5. python 五星红旗

    import turtle turtle.setup(600,400,0,0) turtle.bgcolor("red") turtle.fillcolor("yello ...

  6. PHPUnit 单元测试教程

    一.官网下载对应 PHP 版本的代码库 https://phpunit.de/getting-started-with-phpunit.html 二.安装 PHPUnit 官网提供了两种方法安装 1. ...

  7. 增量ETL (长周期指标) 优化方案

    在日常数据处理过程中避免不了要计算跨长周期数据指标统计需求,类似于如下: 1.  统计每个城市(过去30天)用户浏览次数: 统计每个城市(本年)用户浏览次数: 统计每个城市(历史至今)用户浏览次数: ...

  8. (转)Nginx中sendfile的作用

    原文:https://blog.csdn.net/zhusixun/article/details/81702380 版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上 ...

  9. Mariadb 10.3.17 中启用binlog

    先检查是否开启了binlogSHOW VARIABLES LIKE 'log_bin';如果提示:+---------------+-------+| Variable_name | Value |+ ...

  10. Thinkphp5 实现动态模板主题多个模板切换

    在项目开发过程中会遇到一个网站有不同风格,本文详细介绍Thinkphp5 实现模板主题多个模板切换 一.在Config中配置view_path模板路径代码如下 1 2 3 4 5 6 7 8 9 10 ...