I saw the similar question, however it does not help me. I have this here PHP:
//looping array contains one value - below line not part of code, just for to expmplify
var_dump($categoriesBind) -> array(1) { [0]=> &string(10) "healthcare" }
$sqlPS->bindParam(':belonging', $_GET['belonging']);
$sqlPS->bindParam(':title', $_GET['title']);
//variable number of parameters
for ($i = 0; $i < count($categoriesBind); $i++){
$sqlPS->bindParam(':'.$categoriesBind[$i], $categoriesBind[$i]);
}
The resulting string from that is this:
SELECT * FROM blog_article
WHERE belonging = ':belonging'
AND blog_article.title != ':title'
AND category LIKE '%:healthcare%'
ORDER BY FIND_IN_SET(':healthcare',category) desc LIMIT 0,3
That returns array(0){}
However if i run the query with the filled in parameters manually, it runs fine and returns results. The ':belonging' and ':title' parameters bind fine, the problem is in the other binding interpretations and i can not, for the life of me, figure out what's going on.
UPDATE: upon further testing this is what fails '%:healthcare%'
. The parameters do not bind inside the LIKE syntax.
If more info is needed, please ask.