我有唯一用户名的数据库,我有两个选项可以删除用户:
如何获取用户名字段的ID?
ID代码选项:
if ($checkId > 0) {
$delQi = "DELETE FROM users WHERE id = {$id}";
if ($con->query($delQi)) {
echo "Record deleted successfully";
$con->close();
} else {
//....
}
}
代码|错误|按用户名选择:
$delQu = "DELETE FROM users WHERE username = {$us}";