I have a question, namely - I have created a function that selects certain things from the base. I passed the function argument as bindParam, but I get an empty array. The only way in this case is to insert a variable from the argument directly into the query without binding. What is the reason for this?
function sampleFunction($test, $test2, $db) {
$stmt = $db->prepare("SQL QUERY WITH :test AND :test2");
$stmt->bindParam(':test', $test);
$stmt->bindParam(':test2', $test2);
$stmt->execute();
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
return $result;
}