Reputation: 272
I'm trying to run this query, to select all the rows that have status = 1:
SELECT
acc.id,
acc.user_id,
acc.type,
acc.account,
acc.`status`,
acc.paid,
acc.`password`, CAST(AES_DECRYPT( BASE64_DECODE( `password` ), 'encryption-key') AS CHAR)
FROM acc
WHERE status = status = '1'
However, it returns all the tables, it does't select only the rows that have status = 1
It's probably a syntax error. I do need this
`acc.`password`, CAST(AES_DECRYPT( BASE64_DECODE( `password` ), 'encryption-key') AS CHAR)`
part so I can decrypt the passwords.
What did I do wrong?
Upvotes: 0
Views: 39
Reputation: 19528
acc.
to all the fields given you're only retrieving data from one table.Should be:
SELECT `id`,
`user_id`,
`type`,
`account`,
`status`,
`paid`,
`password`,
CAST(AES_DECRYPT(BASE64_DECODE(`password`),'encryption-key') AS CHAR)
FROM acc
WHERE status = '1'
Upvotes: 1