首页> 开发问题 >后端问题 后端问题
tp3.2插入数据时SQLSTATE[HY000]: General error
作者:小萝卜 2019-09-11 【 TP5 TP3.2 】 浏览 2060
简介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)
相关文章
- PHP查询报错, Fatal error: Allowed memory size of 134217728 bytes exhausted
- Site error: the ionCube PHP Loader needs to be installed.
- TP6报错致命错误: Cannot use object of type stdClass as array
- 错误400-The request sent by the client was syntactically incorrect
- Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in
- [vs code] 运行go包提示:Code is already running!
- 使用mysql_list_tables()方法报错
- MYSQL5.7版本sql_mode=only_full_group_by报错解决方案
- 网站打不开错误提示:ERR_CONTENT_DECODING_FAILED
- MySQL: unrecognized service错误解决办法