1
The problem is this, I have the code concatenated, I need to see this code concatenated if part of it is in the table, ie when joining field 1 and field 2 with PHP, before searching in the table, a variable brings me this pre-programmed, I will have the code:
212e5a8817f6f40da398b9baddddecd28abff2df24b6816fabdf2ff4e64dfd00b192d7f0a2bed8b0b7ab992312978885b4cd079a9d9ea5c955fce646635fa2e2n3fbrqv345d4231qepklnt3i73
I have so this code, I need to put this on like
for him to bring me this code by finding them in two different fields, namely in field to from my table I have
212e5a8817f6f40da398b9baddddecd28abff2df24b6816fabdf2ff4e64dfd00b192d7f0a2bed8b0
and in the field B I have
b7ab992312978885b4cd079a9d9ea5c955fce646635fa2e2n3fbrqv345d4231qepklnt3i73
and in the variable I have
212e5a8817f6f40da398b9baddddecd28abff2df24b6816fabdf2ff4e64dfd00b192d7f0a2bed8b0b7ab992312978885b4cd079a9d9ea5c955fce646635fa2e2n3fbrqv345d4231qepklnt3i73
I have to search this in Mysql and bring me these two field, this is possible?
EDIT
Yeah, it took me a while, but I thought Basic with concat_ws
select * from tabela where concat_ws('',campo1,campo2)
like '%n3fbrqv345d4231qepklnt3i73212e5a8817f6f40da398b9baddddecd28abff2df24b6816fabdf2ff4e64dfd00b192d7f0a2bed8b0b7ab992312978885b4c%';
What is the type of column?
– Ricardo
@Ricardo puts, I think I gave this mole so, I think élongtext, does not work if it is longtext?
– flourigh
I will check, as I did not know what type I did for CHAR and VARCHAR, Aja edit my reply.
– Ricardo
I edited my answer but haven’t found out if it works with longtext
– Ricardo
I figured this would work - select * from table Where Concat(field1, field2) like "%212e5a8817f6f40da398b9baddddecd28abff2df24b6816fabdf2ff4e64dfd00b192d7f0a2bed8b0b7ab992312978885b4cd079a9d9ea5c955fce646635fa2e2n3fbrqv345d4231qklnt3i73%" - but it doesn’t work
– flourigh