I pass a parameter to the function and I want to use it in a regular expression, but this code does not work and does not generate errors. If instead of ':code%' I write '$code%' , i.e. just passing the variable, then the code runs as it should. I want to use exactly the prepared request. Prompt the correct syntax.
function codeFindPart($code) { //... $sql="SELECT code_1 FROM fkko_id WHERE code_1 LIKE ':code%' "; $result=$pdo->prepare($sql); $result->bindParam(":code",$code,PDO::PARAM_STR); $result->execute(); //... }