我在MySql上做错了什么?

时间:2018-01-12 12:31:22

标签: mysql

我想用PHP删除用户,但mysql说用户名不存在

DELETE FROM users WHERE username =".$auser['username']." LIMIT 1

在我的mysql中我有2列

ID | USERNAMES

1 个答案:

答案 0 :(得分:0)

正如它清楚地说username does not exist

username子句中将usernames更改为WHERE

还在'子句中为变量添加单引号WHERE

$sql = "DELETE FROM users WHERE usernames = '".$auser['username']."' LIMIT 1";