You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

执行SQL DELETE查询遇#1054错误:WHERE子句未知列‘Fever’

Fixing the #1054 Error in Your DELETE Statement

Hey there! I see you're building your Diseases Detection Management System with MAMP and phpMyAdmin, and hit a snag when trying to run a DELETE query. Let's figure out what's going wrong and fix it right away.

What's Causing the Error?

The #1054 - Unknown column 'Fever' in 'where clause' error happens because MySQL is misreading your condition. Look at your original query:

DELETE FROM `disease_information` WHERE `Disease_name`=`Fever`

You used backticks (`) around Fever. In SQL, backticks are only for wrapping column or table names (like when your column has a space or conflicts with a SQL keyword). When you wrap a string value like Fever in backticks, MySQL thinks you're referring to a column named Fever—which doesn't exist in your table, hence the error.

The Corrected Query

String values need to be enclosed in single quotes ('), not backticks. Here's the fixed version:

DELETE FROM `disease_information` WHERE `Disease_name`='Fever'

Now MySQL understands that Fever is a value to match against the Disease_name column, not a column itself.

Quick Tips to Avoid This Down the Line

  • Backticks vs Single Quotes: Stick to backticks only for table/column identifiers, and single quotes for string values.
  • Verify Before Deleting: Always run a SELECT first to confirm you're targeting the right records:
    SELECT * FROM `disease_information` WHERE `Disease_name`='Fever'
    
    This prevents accidental deletion of the wrong data!
  • Safe Queries for Apps: If this is part of a PHP application (not just phpMyAdmin), use prepared statements instead of string concatenation to build queries. This avoids syntax errors and protects against SQL injection.

内容的提问来源于stack exchange,提问作者AMINA ARSHAD

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 10:28:08