thevoipman
thevoipman

Reputation: 1833

mysql select where base64 not before

How do I Select a query from mysql and search WHERE it from a column that is based64 encoded?

any kind of help is great appreciated:

SELECT * FROM `customer` WHERE base64_decode(name) LIKE '%bobby%'

Upvotes: 0

Views: 263

Answers (1)

user1864610
user1864610

Reputation:

From MySQL 5.6.1 you can do this with FROM_BASE64().

SELECT * FROM `customer` WHERE FROM_BASE64(name) LIKE '%bobby%'

Earlier versions require a UDF to be installed.

But the question is: why are you encoding data you later want to search on?

Upvotes: 1

Related Questions