Answer the question
In order to leave comments, you need to log in
MySQL - Why does it return NULL due to a MySQL function?
There is a request:
SELECT `password`,UPPER(md5(GROUP_CONCAT(CONCAT_WS(':',`pl_id`,`password`)))) FROM `admins` WHERE name = '%s' AND pl_id = '%d'
Answer the question
In order to leave comments, you need to log in
If nothing is found, then the returned cursor will contain 0 entries, not NULL.
Although any operations with a NULL value return a NULL value.
PS: It's a bit unreasonable to store passwords in the database in plaintext. Any hack leads to the direct disclosure of passwords. It is much safer to store only md5 calculated along with the salt. Even the known value of the salt makes it difficult to directly access the data.
SELECT
CASE WHEN COUNT(`password`) = 0 THEN
'There is no results'
ELSE UPPER(md5(GROUP_CONCAT(CONCAT_WS(':',`pl_id`,`password`)))) END AS
'str'
FROM portal.`channels` c
WHERE name = '%s'
AND pl_id = '%d'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question