MySQL INSERT ... WHERE 语法错误 [英] MySQL INSERT ... WHERE syntax error

查看:60
本文介绍了MySQL INSERT ... WHERE 语法错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里找不到错误的原因,请帮忙

I can't find the reason for the error here, help please

$query = "INSERT INTO users ( name, city, country, phone, twitter, bio, gender ) VALUES ('".$name."', '".$city."', '".$country."', '".$phone."', '".$twitter."', '".$bio."', '".$gender."') WHERE username = '".$username."'";

错误是:

您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以获取在第 1 行的WHERE username = ''"附近使用的正确语法

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 'WHERE username = ''" at line 1

推荐答案

Where 子句不是 Insert 语句的一部分.你不能插入...WHERE

Where clauses are not part of the Insert statements. You cannot INSERT...WHERE

这篇关于MySQL INSERT ... WHERE 语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆