Ok this is weird, I know. I just want ideas about how to deal with it.
I want to do a join
--- ---
A B
--- ---
id id
idB
--- ---
A standard join would be :
SELECT *
FROM B
JOIN A ON A.idB = B.id
WHERE A.id = 3
But here, my idB is not an int foreign key, it is PHP serialized.
For example, instead of being 5, it is "int(5)".
Is there a way to do the join (is there a SQL "serialize" function ?), like that :
SELECT *
FROM B
JOIN A ON A.idB = SERIALIZE(B.id)
WHERE A.id = 3
Important : I can't know the type of the foreign key. Here it is "int(5)", but it can also be a string, an array...