Reputation: 3411
I have a statement in which works fine in PHP, but when I try it in MySQL console, I get an error:
sql> UPDATE users SET password = ? WHERE username = ?
(?=Test, ?=test)
[2014-03-07 17:26:31] [42S22][1054] Unknown column 'test' in 'where clause'
I have tried quotes around the ?
, and many other options.
It should be a simple WHERE
, but it doesn't seem to work in console.
This makes me think it's a bad SQL request, but I can't figure out anything wrong with it.
Upvotes: 2
Views: 3433
Reputation: 23510
You need to surround your string with quotes, so use
(?='Test', ?='test')
Otherwise mysql will treat them as columns which actually don't exist in your table
Upvotes: 4