How do I combine a LIKE query with bind_param,? I tried:
%?%
But I'm doing it wrong and I can't find any reference.
select * from your_table where your_column like concat('%', ?, '%');
and bind the ? to your input value
The naive approach:
select * from your_table where your_column like ?;
$your_input='%'.$your_input.'%';
is vulnerable to SQL Injection and should not be used.
% around the value that you're binding.$your_input contains 'x%' OR 1 = 1 --', the query does not perform as you expect.