首页> 开发问题 >后端问题 后端问题
tp3.2插入数据时SQLSTATE[HY000]: General error
作者:小萝卜 2019-09-11 【 TP5 TP3.2 】 浏览 1814
简介tp3.2插入数据时SQLSTATE[HY000]: General error
刚开始代码这么写的:
运行之后报错:
SQLSTATE[HY000]: General erro
再次运行 OK了
M()->query("insert into ueo44_user(names,phone) values('英文-{$data['names']}','{$data['phone']}')");
运行之后报错:
SQLSTATE[HY000]: General erro
查了下资料发现,当插入数据的时候必须用execute 查询数据的时候用query
更改代码:
M()->execute("insert into ueo44_user(names,phone) values('英文-{$data['names']}','{$data['phone']}')");
再次运行 OK了
很赞哦! (0)
相关文章
- [vs code] 运行go包提示:Code is already running!
- 语法解析错误: syntax error, unexpected 'unset' (T_UNSET)
- Site error: the ionCube PHP Loader needs to be installed.
- MYSQL5.7版本sql_mode=only_full_group_by报错解决方案
- 错误400-The request sent by the client was syntactically incorrect
- TP6报错致命错误: Cannot use object of type stdClass as array
- PHP查询报错, Fatal error: Allowed memory size of 134217728 bytes exhausted
- 使用mysql_list_tables()方法报错
- windows下mysql中文乱码, 配置解决方法
- laravel通过composer安装报错了The 'https://repo.packagist.org/p/laravel/laravel.json' file could not be downloaded: failed to open stream