How to make a query combining 2 fields?

in php there is a certain procedure to create a hash:
$a= md5($b.".md5($c));

As can be done in MySQL in a single query?

This option returns is different from the php hash:
SELECT MD5(b || MD5(c)) FROM `table` WHERE ID = 1;


Concat: returns the 3rd option hash:
SELECT MD5(concat(b,md5(c))) FROM `table` WHERE ID = 1;


So where is the truth that PHP and MySQL have returned a single hash?
July 4th 19 at 23:14
1 answer
July 4th 19 at 23:16
Solution
PHP:
print md5('a'.".md5('b'));
57e9f61da712c151b9d535392036223f


MySQL:
SELECT MD5(CONCAT('a', MD5('b')))
57e9f61da712c151b9d535392036223f


Conclusion - somewhere you have the values b and c are not the same. Well, it is unclear why in PHP the concatenation with an empty string.
In my case b,c this is a field in a MySQL table, not passed string value - lambert_Lynch commented on July 4th 19 at 23:19
I take the values of field b and field c from table where id = 1, and right after you select, trying to form the hash - lambert_Lynch commented on July 4th 19 at 23:22
: What's the difference?
$b = 'test'; 
$c = 'one';
print md5($b.".md5($c));
56e8cfa20757a74727e07538ce53d2a5

SELECT `b`, `c`, MD5(CONCAT(`b`, MD5(`c`))) FROM `test`;
'test', 'one', '56e8cfa20757a74727e07538ce53d2a5'
- Kenyatta commented on July 4th 19 at 23:25

Find more questions by tags MySQL