Neil Yoga Crypto
Neil Yoga Crypto

Reputation: 1035

0 Rows returned on a string search

Query =

SELECT * FROM options WHERE 'key' = 'exchange_rate'

Table structure =

key varchar(500)    latin1_swedish_ci   
value   text    latin1_swedish_ci

Table content

Key           | Value
exchange_rate | 25

Program

phpMyAdmin 4.0.4 Mysql

Result

0 Rows returned

Do you know what the problem is here?

Upvotes: 0

Views: 45

Answers (2)

Charaf JRA
Charaf JRA

Reputation: 8334

try this query:

SELECT * FROM options WHERE `key` = 'exchange_rate'

instead of :

SELECT * FROM options WHERE 'key' = 'exchange_rate'

Upvotes: 2

syed mohsin
syed mohsin

Reputation: 2938

Qoutes are used to show varchar values not column name

SELECT * FROM options WHERE `key` = 'exchange_rate'

Upvotes: 0

Related Questions