我花了好幾個小時試圖解決這個問題。這個SQL有什麼問題?
SELECT *
FROM `users`
WHERE `IP` = `123.231.213.132`
這是什麼問題?
#1054 - Unknown column '123.231.213.132' in 'where clause'
我花了好幾個小時試圖解決這個問題。這個SQL有什麼問題?
SELECT *
FROM `users`
WHERE `IP` = `123.231.213.132`
這是什麼問題?
#1054 - Unknown column '123.231.213.132' in 'where clause'
您不應該使用帶列值的反引號。您必須使用單引號或雙引號,否則mysql會將該值視爲列名稱。
SELECT *
FROM `users`
WHERE `IP` = '123.231.213.132'
使用單引號,而不是反引號字符`123.231.213.132``
SELECT *
FROM `users`
WHERE `IP` = '123.231.213.132'
It might be the single speach mark symbol. Try replacing them manually.
Use quotes ' not backticks ` for string literals
What's with the backticks? Use single quotes Also I'm assuming that users is a table name and IP is an entity of users.
Also...you have to end your statement with a semi-colon
you are using wrong quotation characters
to specify string value in mysql statement you have to use either '(single quote) or "(double quote)
`(backtick) characters are used to explicitly specify that quoted string represents a field name from where mysql should get the data
backticks are required in your statements if column names are conflicting with mysql's reserved keywords like index
,where
等
多麼愚蠢的錯誤。 – Vercas